how to create thread in java?

Answers were Sorted based on User's Feedback



how to create thread in java?..

Answer / manju

Thread can be created by

1. Extending Thread Class
2. implementing Runnable interface

Is This Answer Correct ?    1 Yes 0 No

how to create thread in java?..

Answer / chiranjeevi

threads are created in two ways
1.extending threadclass
2.runnable interface

Is This Answer Correct ?    0 Yes 0 No

how to create thread in java?..

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

how to create thread in java?..

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

how to create thread in java?..

Answer / javamasque

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

how to create thread in java?..

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

how to create thread in java?..

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

Post New Answer

More OOPS Interview Questions

how to swap to variables without using thrid variable in java?

5 Answers  


What is the differances between a abstract calss and interface

5 Answers   Aviva, Symphony,


What do you mean by inheritance?

0 Answers   IBS,


Difference ways of Polymorphism?

3 Answers  


what is opps?why it is use in programming language?

2 Answers   Wipro,


Difference between over loading and over ridding?

12 Answers   CTS, Patni, Softvision Solution,


suppose A is a base class and B is the derved class. Both have a method foo which is defined as a virtual method in the base class. You have a pointer of classs B and you typecast it to A. Now when you call pointer->foo, which method gets called? The next part of the question is, how does the compiler know which method to call?

3 Answers   EA Electronic Arts,


What is the fundamental idea of oop?

0 Answers  


What is meant by oops concept?

0 Answers  


Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.

0 Answers  


What makes a language oop?

0 Answers  


Write a macro for swapping integers

5 Answers  


Categories