@Override
public void run(){
try {
Thread.sleep(1000);
} catch (InterruptedException e){
e.printStackTrace();
}
System. out .print( "run" );
}
public static void main(String[] args){
Example example= new Example();
example.run();
System. out .print( "main" );
此题选A
因为Example的run方法里面休眠了100ms,在当今电脑计算性能过剩的时代,如果是多线程启动,main方法肯定会打印出了main。
为啥是runmain而不是mainrun呢?
没有看到start。所以是普通方法调用。
所以选A。