class SimpleThread extends Thread
{
public void run()
{
int count=0;
while(count<3)
{
System.out.println(Thread.activeCount());
String name=Thread.currentThread().getName();
count++;
if(name.equals("Thread1"))
{
System.out.println("good");
}
else
{
System.out.println("bye");
}
}
}
/*
SimpleThread st = new SimpleThread();
st.setName("Thread1");
System.out.println(st.isAlive());
SimpleThread st1 = new SimpleThread();
st.start();
st1.start();
System.out.println(st.isAlive());
System.out.println("main say");*/
}