天空是蓝色的

做好软件为中国 #gcc -c helloworld.c -o helloworld.o //编译目标文件 #gcc helloworld.o -o helloworld //编译成可执行exe #helloworld //运行exe
数据加载中……
多线程基础
public class NewThreadTest {
    
public static void main(String args[]) {//main函数

        
new Thread(new Runnable() {

            
public void run() {
                
// TODO Auto-generated method stub
                while (true{
                    System.out.println(
"Helllworld");
                    
try {
                        Thread.sleep(
10000);
                    }
 catch (InterruptedException e) {
                        
// TODO Auto-generated catch block
                        e.printStackTrace();
                    }

                }


            }


        }


        ).run();
    }


}

posted on 2005-12-12 09:35 bluesky 阅读(261) 评论(0)  编辑  收藏 所属分类: 工作总结


只有注册用户登录后才能发表评论。


网站导航: