how to create thread in java?

Answer Posted / gurpreet singh

there are two ways to creat the thread:
1. by implement Runnable interface
2. by extends Thread
NOW which one is batter apprach
implement Runnable Thread is batter apporach
because in inheritance does not allow its
class to extends more than one...
Where we use mutiple inheritance then we creat
a Thread by using implement runnable interface
that why its batter apporach
ok concept is understood.
Gurpreet singh

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between data abstraction and encapsulation?

619


how to get the oracle certification? send me the answer

1670


What is for loop and its syntax?

598


Why do we need oop?

671


What is difference between class and object with example?

565






Can static class have constructor?

587


write a C++ program for booking using constructor and destructor.

2055


What are the features of oop?

641


hi all..i want to know oops concepts clearly can any1 explain??

1683


What are the benefits of oop?

607


Plese get me a perfect C++ program for railway/airway reservation with all details.

3431


How to handle exception in c++, For example in a functions i am assigning memory to some variables and also in next instructions in am dividing one variable also. If this functions generates a error while allocating memory to those variable and also while dividing the variable if i divide by zero then catch block how it will identify that this error has cone from perticular instruction

1654


What is destructor in oop?

625


What is destructor oops?

625


What are the benefits of interface?

583