class ThreadTest implements Runnable{
public void run(){
System.out.println (Thread.currentThread().getName());
}
public static void main (String[] args) {
ThreadTest tt = new ThreadTest();
//Thread t = new Thread (tt,"eat apple");
Thread t = new Thread (tt);
t.setName("eat apple");
t.start();
}
}
|