1. 程式人生 > 其它 >樹莓派系統安裝(ubuntu版本)無需螢幕

樹莓派系統安裝(ubuntu版本)無需螢幕

public interface Printer {
    void print();
}


/***********************************/


public class ColorfulPrinter implements Printer{
    @Override
    public void print() {
        System.out.println("this is colorful printer!!!");
    }
}


/***********************************/


public class BlackWhitePrinter implements
Printer{ @Override public void print() { System.out.println("this is black white printer!!!"); } } /***********************************/ public class T { public static void main(String[] args) { Printer cp = new ColorfulPrinter();
Printer bp
= new BlackWhitePrinter();
Printer ap
= new Printer() { @Override public void print() { System.out.println("this is anonymous printer"); } };
Printer lp
= () -> System.out.println("this is anonymous printer"); cp.print(); bp.print(); ap.print(); lp.print(); } }