1 Reply Latest reply on Aug 19, 2006 6:42 AM by Shi Xing Huang

    please help!!!

    Shi Xing Huang Newbie

      Class Test implements Runnable
      {
      public void one(){
      {
      System.out.println("Thread start");
      Thread tt = new Thread(this);
      tt.start();
      }
      }
      --------------------------------------------
      I want to change the above code to this:
      Class Test implements Runnable
      {
      public void one(){
      {
      System.out.println("Thread start");
      MyThread tt = new MyThread(this);
      tt.start();
      }
      }

      the MyThread isn't the instace of Thread!! ,but it has the start method!
      class MyThread
      {
      MyThread(Runnable _runnable)
      {
      }

      public void start()
      {
      }
      }

      -----------------------------------------
      how to do it? pleases help me!!

        • 1. Re: please help!!!
          Shi Xing Huang Newbie

          Another case!!!

          Class Test implements Runnable
          {

          Thread tt = null;
          public void one(){
          {
          System.out.println("Thread start");
          tt = new Thread(this);
          tt.start();
          }
          }
          --------------------------------------------
          I want to change the above code to this:
          Class Test implements Runnable
          {

          MyThread tt = null;
          public void one(){
          {
          System.out.println("Thread start");
          tt = new MyThread(this);
          tt.start();
          }
          }