How many ways can a thread be used?
Answer Posted / muruganantham
Two ways we can using in Thread. One is Thread class and
another one is Runnable interface. If we are using extends
Thread class means you must override the run() method. We
can create a thread object after that we used start method.
Its only one waiting (wait())thread can be executed
Ex:
Thread t=new Thread();
t.start();
If we are using implement Runnable Interface means you need
not override the run() method. We can passing the parameter
is thread . Its more than one waiting (wait())thread can be
executed.
Hi
This is Muruga. Sorry for gramatical mistake bze that my
level. If any feed back pl reply to my mail id
sunjavamuruga@gmail.com
| Is This Answer Correct ? | 8 Yes | 1 No |
Post New Answer View All Answers
What is the difference between the ‘font’ and ‘fontmetrics’ class?
Why a component architecture for the java platform?
Which are the different segments of memory?
What is the difference between system.out ,system.err and system.in?
What is clustering? What are the different algorithms used for clustering?
What is the purpose of the notifyall() method?
If I wanted to use a solarisui for just a jtabbedpane, and the metal ui for everything else, how would I do that?
Why won’t the jvm terminate when I close all the application windows?
Explain about thread synchronization inside a monitor?
Name three component subclasses that support painting?
What is scalable, portability in the view of J2EE?
In inglish: How to convert jar to exe files? Em português: Como converter arquivos .jar para .exe?
Why use POJO when I can use hashmap
What is mdb and what is the special feature of that?
What is meant by method chaining?