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


Please Help Members By Posting Answers For Below Questions

how i secure my site with the https protocol.what are the steps?

1732


How to deploy Jar, War files in J2EE?

2168


How are the elements of a cardlayout organized?

594


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 ..

1732


What are the pros and cons of detached objects?

543






What is the difference between the session.get() method and the session.load() method?

598


Why a client should be multithreading? Explain.

589


Difference between DurableSubscription and non- DurableSubscription?

1710


What do you mean by Socket Programming?

543


How many times may an objects finalize() method be invoked by the garbage collector?

668


Explain RMI Architecture?

604


What is the purpose of the wait() method?

617


Why does the tag url-encode javascript and mailto links?

577


Is the session factory thread safe?

668


What is a modular application?

586