java98-线程join使用中断进行另一个
 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);
         }
     }
 }
 运行结果

                
            
        
浙公网安备 33010602011771号