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/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create.
What is a mixin class?
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash
Why oops is important?
What is nutshell in programming language?
1 Answers Satyam, Tech Mahindra,
Differences between inline functions and non-inline functions?
How would you stop a class from class from being derived or inherited.
explain dynamic binding by drowing
why to use template classes in c++?
what is the use of template classes in c++
What is encapsulation in simple terms?
what is the advantage in software? what is the difference between the software developer and Engineer