package threadExample; /** * @author ksingh2 * */ public class SimpleThread extends Thread { public static void main(String[] args) { SimpleThread threadOne=new SimpleThread(); threadOne.setName("First Thread"); SimpleThread threadTwo=new SimpleThread(); threadTwo.setName("Second Thread"); threadOne.start(); threadTwo.start(); } /* * Here we put the work we want this Thread to do. * (non-Javadoc) * @see java.lang.Thread#run() */ @Override public void run() { // TODO Auto-generated method stub super.run(); System.out.println("i am "+Thread.currentThread().toString()); } }