请问下面的代码输出什么:
public class TestThread {
static class A extends Thread {
A (Runnable r) {
super(r);
}
@Override
public void run() {
super.run();
System.out.println("hello thread");
}
}
public static void main(String[] args) {
new A(() -> System.out.println("hello Runnable")).start();
}
}
正确的答案是:
这道题能很好的考察面试者对继承,线程启动源码以及Lambda表达式的理解。