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 diffrence between a local-tx-datasource and a xa-datasource?
what are getters and setters in Java with examples?
what is a portable component?
For which statements does it make sense to use a label?
How to implement dphibernate to activate lazy loading in Flex with java ?thanx in advance!
What is the RMI and Socket?
What is ripple effect?
Why are my checkboxes not being set from on to off?
Why are some of the class and element names counter-intuitive?
int x=5,i=1,y=0; while(i<=5) { y=x++ + ++x; i=i+2; } System.out.println(x); System.out.println(y); System.out.println(i); How to solve this? Please explain!
What restrictions are placed on the values of each case of a switch statement?
Can we sent objects using Sockets?
Which container method is used to cause a container to be laid out and redisplayed?
What event results from the clicking of a button?
Can you control when passivation occurs?