题目内容

阅读程序,写出其输出结果:interface Com{int get(int a,int b);}public class E{public static void main(String args[ ]){Com com=(a,b)->{return a+b;};System.out.println(com.get(12,8));}}

查看答案
更多问题

阅读程序,写出其输出结果:interfaceSpeakHello{voidspeak();}classHelloMachine{publicvoidturnOn(SpeakHellohello){hello.speak();}}publicclassE{publicstaticvoidmain(Stringargs[]){HelloMachinemachine=newHelloMachine();machine.turnOn(()->{System.out.println("welcome!");});}}

创建一个多线程程序时可以通过实现类________, 也可以通过实现接口________

线程调度时要根据线程的优先级进行,线程的优先级可分为1 0 种,其中________代表优先级最高,_______ 代表优先级最低。

阅读下面的程序,分析代码是否能编译通过。如果能编译通过,请列出运行的结果;如果不能编译通过,请说明原因。class RunHandler {public void run() {System.out.println("run");}}public class Read01 {public static void main(String [] args) {Thread t = new Thread(new RunHandler( ));t.start( );}}

答案查题题库