guanxf

我的博客:http://blog.sina.com.cn/17learning

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  71 随笔 :: 1 文章 :: 41 评论 :: 0 Trackbacks
package com.gxf.basic;
public class ThisDemo {
   int i=1;
   public ThisDemo(){
  Thread thread=new Thread(){
  public void run(){
    for(;;){
    ThisDemo.this.run();
    try{
      sleep(1000);
    }catch(Exception e){
    e.printStackTrace();
    }
    }
  }
  };
  thread.start();
   }
  public void run(){
   System.out.println(i);
   i++;
  } 
   public static void main(String[] args) {
new ThisDemo();
}
}
posted on 2011-09-25 11:07 管先飞 阅读(250) 评论(0)  编辑  收藏 所属分类: Java技术

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


网站导航: