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
Why use a datasource when you can directly specify a connection details? (in a J2EE application)
What are the benefits of detached objects?
Why doesn’t the focus feature on the tag work in every circumstance?
What is metaspace?
What is Stream Tokenizer?
What is a policy?
What is ioc concept?
Where can I find seam examples and documentation?
What is the relationship between local interfaces and container-managed relationships?
whats is statement and procedure
How are the elements of a borderlayout organized?
How can I avoid validating a form before data is entered?
Why are my checkboxes not being set from on to off?
Explain how will the struts know which action class to call when you submit a form?
How to implement dphibernate to activate lazy loading in Flex with java ?thanx in advance!