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
how i secure my site with the https protocol.what are the steps?
How to deploy Jar, War files in J2EE?
How are the elements of a cardlayout organized?
cud u help me ... i am struggling with this question... to find all the subsets of a given set for ex.... a,,b,c shud give all the subsets.... i gt the program in c bt nt able to get it in java..... help needed ..
What are the pros and cons of detached objects?
What is the difference between the session.get() method and the session.load() method?
Why a client should be multithreading? Explain.
Difference between DurableSubscription and non- DurableSubscription?
What do you mean by Socket Programming?
How many times may an objects finalize() method be invoked by the garbage collector?
Explain RMI Architecture?
What is the purpose of the wait() method?
Why does the tag url-encode javascript and mailto links?
Is the session factory thread safe?
What is a modular application?