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
How are the elements of a borderlayout organized?
What is the form of storage space in java?
What are the call back methods in entity bean?
AS a developer will u create a data source in connection pool? If so how will u do that, how to access the object from connection pool using IRAD tool?
What is the argument type of a programs main() method?
To what value is a variable of the string type automatically initialized?
Where can I find seam examples and documentation?
What is the diffrence between a local-tx-datasource and a xa-datasource?
What if the static modifier is removed from the signature of the main method?
How task's priority is used in scheduling?
Explain the different types of memory used by jvm?
What is in-memory replication?
Why use POJO when I can use hashmap
What are the diff types of exception?
What happens when a thread cannot acquire a lock on an object?