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

Why we use beans in java?

528


explain how java se 8 data and time api solves issues of old java date api?

556


What is an actionevent in java?

450


What is java language expression?

493


What is maven in java?

455






What is persistence xml in java?

491


What is hql in java?

485


What is @override annotation in java?

484


What is lazy loading in jpa?

437


Is it better to learn java or python?

457


Which is best framework in java?

491


What is native api in java?

483


What is the use of lambda functions?

489


What are tlds in java?

481


What is stateful in java?

493