www.baidu.com

          JavaCode--我愛(ài)你,芳兒

          JavaStudy--我愛(ài)你,芳兒

          關(guān)于線程學(xué)習(xí)打的代碼

          關(guān)于線程學(xué)習(xí)打的代碼 //by EditPlus
          class ThreadTest extends Thread
          {
              
          public void run()
              {
                  System.out.println(
          "the thread is running!");
              }
              
          public void run(String s)
              {
                  System.out.println(
          "thethread is :" + s);
              }
              
          public static void main(String[] args)
              {
                  ThreadTest threadTest1 
          = new ThreadTest();
                  Thread thread1 
          = new Thread(threadTest1);
                  thread1.start();
                  
          for(int i  = 0; i <= 1100; i++);
                  
          //when you write the i++,you should not write it like this:i ++..there is no space between the i and the ++!!be careful!
                  threadTest1.run("wo ai ni babe!");
              }

          }

          public class PingPong extends Thread
          {
              
          private String word;
              
          private int delay;
              
          public PingPong(String s,int i)
              {
                  word 
          = s;
                  delay 
          = i;
              }
              
          public void run()
              {
                  
          try 
                  {
                      
          forint i = 1; i <= 100; i++)
                      {
                          System.out.println(word 
          + "is what i want!");
                          Thread.sleep(delay);
                      }
                  }
                  
          catch(InterruptedException e)
                  {
                      
          return;
                  }
              }
              
          public static void main(String argv[])
              {
                  
          new PingPong("wo",30).start();
                  
          new PingPong("wod",100).start();
              }

          }


          public class ThreadTest1 implements Runnable
          {
              
          public ThreadTest1()
              {
                  System.out.print(
          "babe!");
              }
              
          public ThreadTest1(String s)
              {
                  System.out.print(
          "BABE " + s);
              }
              
          public void run()
              {
                  System.out.println(
          "what I want is your heart and your body!");
              }
              
          public static void main(String[] args)
              {
                  ThreadTest1 th 
          = new ThreadTest1();
                  Thread thread 
          = new Thread(th);
                  ThreadTest1 th1 
          = new ThreadTest1("Wjf");
                  Thread thread1 
          = new Thread(th1);
                  thread.start();
                  thread1.start();
              }
          }


           

          芳兒寶貝.我愛(ài)你

          posted on 2007-12-08 18:01 wǒ愛(ài)伱--咾婆 閱讀(225) 評(píng)論(0)  編輯  收藏 所屬分類: JavaCode

          導(dǎo)航

          統(tǒng)計(jì)

          公告

          芳兒寶貝.我愛(ài)你


          黑客基地
          http://www.hackbase.com
          全球最大的黑客門戶網(wǎng)站


           最近在讀的書(shū):

          常用鏈接

          留言簿(1)

          隨筆分類(37)

          JavaCode

          搜索

          積分與排名

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          主站蜘蛛池模板: 成武县| 扶绥县| 张家界市| 清流县| 永川市| 荆州市| 清苑县| 冕宁县| 巴马| 延吉市| 阳东县| 锦屏县| 湄潭县| 三穗县| 开江县| 八宿县| 楚雄市| 灵川县| 三门峡市| 治县。| 兴国县| 长海县| 延寿县| 拜城县| 桓仁| 金昌市| 宁德市| 大化| 陆河县| 张北县| 大荔县| 海盐县| 绵竹市| 舞阳县| 安西县| 绥化市| 洛南县| 临西县| 尚义县| 铁力市| 漠河县|