下列 Java 代码的运行结果是()
public class MyThread extends Thread{ public static void main(String args[]){ MyThread thread = new MyThread(); thread.run(); } public void start(){ for(int i = 0; i < 5; i++) { System.out.print(i); } } }
public class MyThread extends Thread{ public static void main(String args[]){ MyThread thread = new MyThread(); thread.run(); } public void start(){ for(int i = 0; i < 5; i++) { System.out.print(i); } } }
顺序输出0到4
编译错误,找不到run()方法
编译正常,无输出
乱序输出0到4