Answer Posted / s.ramesh
import java.util.*;
public class DemoThread extends Thread {
private Thread t = null;
public DemoThread() {
t= new Thread(this, "RacingThread");
t.start();
}
public static void main(String[] args) {
DemoThread dt = new DemoThread();
dt.setName("DemoThread");
dt.start();
}
public void run()
{
while(true)
{
try
{
this.sleep(5000);
}
catch(Exception e)
{
System.out.println("Exception Occured");
}
}
}
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Explain phantom read?
What are the diff types of exception?
How substring() method of string class create memory leaks?
Explain about thread synchronization inside a monitor?
Where we can write Rmi registry in the code, without having to write it at the command prompt?
What is glasgow?
What is synchronization and why is it important?
What class is used to create Server side object ?
What are the steps to write p-to-p model application?
Which characters may be used as the second character of an identifier, but not as the first character of an identifier?
How are commas used in the intialization and iteration parts of a for statement?
What is ioc concept & explain it?
What are the difference between RMI and CORBA?
Why is actionform a base class rather than an interface?
What is message driven beam?