class MyRunnable implements Runnable{
public void run(){
System.out.println(Thread.currentThread().getName());
}
}
MyRunnable myRunnable = new MyRunnable();
Thread thread = new Thread(myRunnable);
thread.start();