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 the purpose of the notifyall() method?
Name three subclasses of the component class?
Can constructors be synchronized in java?
hi friends, i have done my BE(CSE)at 2011 then i have joined one company before they asked me 50k so i paid but now they telling no project here so we r going to close like that so now i need any job i have good knowledge in core java and j2ee(jsp,servlet,jdbc) so if u know any job pl help me
Why a client should be multithreading? Explain.
How will you pass parameters in RMI? Why do you serialize?
What is the difference between static and non-static with examples?
whats is statement and procedure
Write a program to show synchronization?
What do you need to set-up a cluster with jboss?
When a thread blocks on i/o, what state does it enter?
What is JTS?
Why do threads block on i/o?
How to implement RMI in Java?
How primary key is implemented in Oracle?