标签:
class Do3 { public static void main(String[] args) { XC d1=new XC("小王"); XC d2=new XC("xiaoli"); d1.start();//启动线程,调用run()方法 d2.start(); System.out.println("Hello World!"); } } class XC extends Thread//继承线程 { private String name; XC(String name) { this.name=name; } public void run()//重写run()方法 { for(int x=0;x<10;x++) { for(int y=-999999;y<999999;y++){} System.out.println(name+"....="+x); } } }
标签:
原文地址:http://www.cnblogs.com/zywf/p/4711928.html