package com.company.bingfa;
class MyThread17 extends Thread{
@Override
public void run() {
for (int i = 0; i < 100; i++) {
System.out.println(getName()+" "+i);
if(i == 30){
System.out.println(getName()+" pause");
yield();
}
}
}
}
public class MyYield {
public static void main(String[] args) {
MyThread17 t1 = new MyThread17();
MyThread17 t2 = new MyThread17();
t1.start();
t2.start();
}
}
99万+

被折叠的 条评论
为什么被折叠?



