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 a non-repeatable read?
Write a program to show synchronization?
What is the difference between RMI registry and OS Agent?
How are commas used in the intialization and iteration parts of a for statement?
Should synchronization primitives be used on bean methods?
What is the relation between the infobus and rmi?
Which container method is used to cause a container to be laid out and redisplayed?
What are the types of scaling?
What classes of exceptions may be caught by a catch clause?
Explain about local interfaces.
Which containers use a border layout as their default layout?
What is permgen or permanent generation?
why static class in java
What are the call back methods in entity bean?
Explain about RMI Architecture?