阅读(1575)
赞(1)
创建线程1--继承Thread
2019-07-07 16:02:53 更新
public class MyThread extends Thread {
@Override
public void run() {
// TODO Auto-generated method stub
for(int i = 0; i < 30; i++) {
System.out.println(Thread.currentThread().getName()+":i="+i);
}
}
public static void main(String[] args) {
new MyThread().start();
new MyThread().start();
}
}
← 运算符优先级