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 colon_pkg_prefixes and what is its use?
Have you used threads in Servelet?
What does module-relative mean?
What is the relationship between an event-listener interface and an event-adapter class?
What is the difference between static and non-static with examples?
In our urls and in the text of the buttons we have comma. Its causing an error. Is there a way to change the delimiting character for the menu arguments?
Brief description about local interfaces?
What is Stream Tokenizer?
Explain the different types of memory used by jvm?
Which containers use a border layout as their default layout?
Is the ternary operator written x : y ? Z or x ? Y : z ?
What are the services in RMI ?
How will you pass parameters in RMI? Why do you serialize?
Which are the different segments of memory?
If your ui seems to freeze periodically, what might be a likely reason?