3 Replies Latest reply: Jun 27, 2008 2:40 AM by 807589 RSS

    error with thread

    807589
      this example is taken from this website
      http://exampledepot.com/egs/java.lang/BasicThread.html
      however, i am trying to link 2 classes together.
      Here are my codes.

      A
      package ABC;
      
      public class A {
      
           public static void main(String[] args) throws IOException {
      //(some codes)
      B.BasicThread2 runnable = new BasicThread3();
               Thread thread = new Thread(runnable);
               thread.start();
      B
      package ABC;
      
      public class B{
      class BasicThread2 implements Runnable {
                public void run() {
                     //(some codes)
                     }
              }
          }
      i get an error at B.BasicThread2 runnable = new BasicThread3();
      it says "BasicThread3 cannot be resolved to a type.

      what should i do to fix this?

      tq