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

Why use a datasource when you can directly specify a connection details? (in a J2EE application)

3821


What are the benefits of detached objects?

794


Why doesn’t the focus feature on the tag work in every circumstance?

774


What is metaspace?

762


What is Stream Tokenizer?

1947


What is a policy?

2005


What is ioc concept?

915


Where can I find seam examples and documentation?

799


What is the relationship between local interfaces and container-managed relationships?

814


whats is statement and procedure

1801


How are the elements of a borderlayout organized?

833


How can I avoid validating a form before data is entered?

726


Why are my checkboxes not being set from on to off?

889


Explain how will the struts know which action class to call when you submit a form?

699


How to implement dphibernate to activate lazy loading in Flex with java ?thanx in advance!

2764