cant we call run() method directly instead of calling indirectly through the start()
method ? if we do so then what is the problem ?

Answer Posted / damodar narayan

Calling run() method is just like calling a method in java. So when called, it just gets executed but "we do not get the thread functionality by calling the run() method". But calling start() method registers your program with the thread scheduler and hence it achieves the threading functionality. Start in turn calls the runs method.

Hope its clear.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is microservices java?

464


What are struts java?

486


Which version of my browser should I use? : java security

504


Why java?

538


What is a dao layer in java?

447






What is javacpl?

497


Is java built on c?

495


Describe the principles of oops.

498


Can I have multiple main methods in the same class?

481


How do I install eclipse?

481


What happens when you omit a brace or misspell one of the words, like public or

471


What is map and flatmap?

617


Why bean class is used in java?

449


What is java ioc?

489


Is lambda expression an object?

491