while creating thread why we extend thread class

Answers were Sorted based on User's Feedback



while creating thread why we extend thread class..

Answer / jayaprasad

calling the Thread class methods like start().

Threads can be created in two ways
1) extends Thread class
2) implementing Runnable interface.

Is This Answer Correct ?    10 Yes 0 No

while creating thread why we extend thread class..

Answer / pamal janveja

To create User Defined thread, We requires features of thread
and java provide us Thread class.
We simply over right its run method and called this by start method which internally call to run method.
Similarly using other methods of Thread class , we can create,access and delete user defined thread.

Note:- Without Thread class or Runnable interface , We can not create User defined Thread.

Is This Answer Correct ?    6 Yes 0 No

Post New Answer

More Core Java Interview Questions

What are the two types of java programming?

0 Answers  


How we get some middle records in one table?

2 Answers   3i Infotech,


What is use of a abstract variable?

0 Answers  


In a container there are 5 components. I want to display all the component names, how will you do that?

0 Answers  


Similarity and difference between static block and static method ?

0 Answers  






How to change value in arraylist java?

0 Answers  


What is System class and its purpose?

2 Answers  


How do you insert a line break?

0 Answers  


How to prevent a field from serialization ?

2 Answers  


Can you override private or static method in java?

0 Answers  


What are the three parts of a lambda expression?

0 Answers  


Why multiple inheritance is not supported by java?

0 Answers  


Categories