how to create thread in java?

Answer Posted / bijoy kumar baral

There is two ways for creating Thread in Java:
1.Extending Thread class

2.Implementing Runnable Interface

Second one is much more benificial than 1st one,as we can
able to avoid the overriden methods.

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why we use classes in oop?

585


What is oops concept with example?

580


What is the full form of oops?

613


There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.

1460


What is polymorphism in oops?

561






Explain the concepts involved in Object Oriented programming.

643


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

1655


What is overriding in oops?

606


INSTANCE FIELDS DECLARED private ARE ACCESSIBLE BY THE METHODS ONLY.CAN WE CHANGE THE private FIELD OF AN OBJECT IN A METHOD OF SOME OTHER OBJECT OF THE SAME CLASS?

1639


What is an interface in oop?

596


Why multiple inheritance is not possible?

603


What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?

1654


What is object and example?

604


Why do we use polymorphism?

579


What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?

2110