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
When a thread blocks on i/o?
Write a program to show synchronization?
In inglish: How to convert jar to exe files? Em português: Como converter arquivos .jar para .exe?
What is the difference between the ‘font’ and ‘fontmetrics’ class?
What is the purpose of the notify() method?
What is the difference between the session.get() method and the session.load() method?
hi friends, i have done my BE(CSE)at 2011 then i have joined one company before they asked me 50k so i paid but now they telling no project here so we r going to close like that so now i need any job i have good knowledge in core java and j2ee(jsp,servlet,jdbc) so if u know any job pl help me
what is an isolation level?
What is the difference between session and entity beans?
How would you reatach detached objects to a session when the same object has already been loaded into the session?
What restrictions are placed on the location of a package statement within a source code file?
How are commas used in the intialization and iteration parts of a for statement?
what is a portable component?
whats is mean by tiles in struts
what are RemoteObjects?