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 crud operations in java?

658


Can we extract main method from another class?

704


What is dto in java?

694


What is @qualifier in java?

693


What is a java singleton?

634


What is a flatmap?

667


Can I have multiple main methods in the same class?

656


What is a cookie in java?

708


Describe life cycle of thread?

738


Which instutute is offering course for rhino jain slee

2048


Why is struts used in java?

648


What is static class in java?

690


What is the use of servlet in java?

700


What is jpa implementation?

652


what is the package for freshers in valuelabs.

5880