/** * * @author ksingh2 * */ public class RunnableExample implements Runnable { public void run() { // TODO Auto-generated method stub System.out.println("i am "+Thread.currentThread().toString()); } public static void main(String[] args) { RunnableExample runnableExample=new RunnableExample(); Thread threadOne=new Thread(runnableExample); threadOne.setName("First Thread"); Thread threadTwo=new Thread(runnableExample); threadTwo.setName("Second Thread"); threadOne.start(); threadTwo.start(); } }