how to create thread in java?
Answers were Sorted based on User's Feedback
Answer / manju
Thread can be created by
1. Extending Thread Class
2. implementing Runnable interface
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / chiranjeevi
threads are created in two ways
1.extending threadclass
2.runnable interface
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / teja
We r creating threads in java by extending d thread class
or by implementing runnable interface.
Syntax for creaton of thread is:
Thread var=new Thread(Runnableobject,"Stringname");
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / ravi gandhi
threads are created in two ways
1.implementing Runnable interface
2.Extending Thread Class
in thees two ways implements runnable interface is better
option because it supports multilevle thread cocept
| Is This Answer Correct ? | 0 Yes | 0 No |
Threads are created in three ways
1. Sub-class Thread: Create sub-class of java.lang.Thread class
2. Runnable object: Implementing java.lang.Runnable interface.
3. Callable object: Implementing java.lang.Callable interface.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / hari
It can also be created in number of ways.
1.Extended threadclass
2.Running thread
| Is This Answer Correct ? | 2 Yes | 3 No |
Answer / solanki
It was created by extended from Thread class
and also we can create from interface thred
| Is This Answer Correct ? | 2 Yes | 8 No |
write a c++ code to overload + and - for a stack class such that + provides push and - provides pop operation
1 Answers College School Exams Tests, HCL, IBM, TCS,
What is difference between function overloading and overriding?
what is costructor?
Why do we use encapsulation in oops?
What is abstract class in oops?
is there any choice in opting subjects like 4 out of 7
How to use CMutex, CSemaphore in VC++ MFC
WHEN A COPY CONSTER IS CALL ?
What is encapsulation in oop?
write a program to enter a string like"sunil is a good boy and seeking for a job" not more than 10 characters including space in one line,rest characters should b in other line.if the next line starts from in between the previous word,then print whole word to next line.
1. Strong name 2. how to prevent a class from being inherited 3. delegates 4. default modifier for interface 5. default modifier for class 6. base class for exception 7. diff bet trigger and view in sql 8. how to exchange values from one page to another page 9. can multiple catch block ll be executed at same time 10. can u store different data types in an array & array list 11. when we ll use trigger 12. try,catch,finally usage
What exactly is polymorphism?