| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 671 人关注过本帖
标题:eclipse中两个进程不能同时进行,为什么?
取消只看楼主 加入收藏
lingyunhappy
Rank: 2
等 级:论坛游民
帖 子:40
专家分:45
注 册:2010-3-8
结帖率:75%
收藏
已结贴  问题点数:10 回复次数:0 
eclipse中两个进程不能同时进行,为什么?
public class TestThreadDemo {
    public static void main(String[] args)
    {
    new TestThread().start();
    for(int i=1;i<=10;i++)
        System.out.println("The main is running!");
    }

}
class TestThread extends Thread
{
    public void run()
    {
        for(int i=1;i<=10;i++)
            System.out.println("The TestThread is running!");
    }
}
这是结果:
The main is running!
The main is running!
The main is running!
The main is running!
The main is running!
The main is running!
The main is running!
The main is running!
The main is running!
The main is running!
The TestThread is running!
The TestThread is running!
The TestThread is running!
The TestThread is running!
The TestThread is running!
The TestThread is running!
The TestThread is running!
The TestThread is running!
The TestThread is running!
The TestThread is running!

应该是两个进程交替的来啊,怎么是一个完了才是另一个呢 跟教科书上的不一样哦
搜索更多相关主题的帖子: eclipse 进程 
2010-11-18 09:37
快速回复:eclipse中两个进程不能同时进行,为什么?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.037116 second(s), 10 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved