public class test33 { public static void main ( String [] args ) { Xc46 xc46 = new Xc46 (); Thread dd = new Thread ( xc46 ); dd . start (); try { dd . join (); } catch ( Exception e ) { } for ( int i = 0 ; i 15 ; i ++ ) { System . out . pri
public class test33 {
public static void main(String[] args) {
Xc46 xc46=new Xc46();
Thread dd = new Thread(xc46);
dd.start();
try {
dd.join();
} catch (Exception e) {
}
for (int i=0;i<15;i++) {
System.out.println("主函数"+i);
}
}
}
class Xc46 implements Runnable {
public void run() {
for (int i = 0; i < 30; i++) {
System.out.println( "歌谣" + i);
}
}
}
运行结果