error in threads
class RunnableThread implements Runnable {
Thread RunningThread;
public RunnableThread() {
}
public RunnableThread(String ThreadName) {
RunningThread = new Thread(this, ThreadName); // (1) Create a new thread.
System.out.println(RunningThread.getName());
RunningThread.start(); // (2) Start the thread.
}
public void run() {
//Display info about this particular thread
System.out.println(Thread.currentThread());
}
}
public class RunnableExample {
public static void main(String[] args) {
Thread thread1 = new Thread(new RunnableThread(), "thread1");
Thread thread2 = new Thread(new RunnableThread(), "thread2");
RunnableThread thread3 = new RunnableThread("thread3");
//Start the threads
thread1.start();
thread2.start();
try {
//delay for one second
Thread.currentThread().sleep(1000);
} catch (InterruptedException e) {
System.out.println("There has been an Exception, Take care of it!");
}
//Display info about the main thread
System.out.println(Thread.currentThread());
}
}
this is thre tutorial program itself its giving me 3 errors
class Runnable Example :5:cannt find symbol
symbol: constructor Thread(Runnable Thread,java.lang.String)...........
plz help