1. //此项目用来跑临时碰到的问题。。  
  2. /*    此程序使用死循环测试多进程的运行。    
  3. package test; 
  4.    
  5. public class Example { 
  6.     public static void main(String[] args) { 
  7.         while(true) { 
  8.             int a=(int) (Math.random()*100);  //获得一个100以内的随机数 
  9.             System.out.println("main thread is run "+a); 
  10.             try { 
  11.                 Thread.sleep(3000); 
  12.             }catch (InterruptedException e){ 
  13.                 e.printStackTrace(); 
  14.             } 
  15.         } 
  16.     } 
  17.    
  18. } 
  19. */  
 posted on 2019-03-21 03:29  LXHYouth  阅读(193)  评论(0编辑  收藏  举报