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
What is the locale class?
What is the means of java?
Why do we create dto in java?
Why is javac not recognized?
Does jvm maintain a cache by itself? Does the jvm allocate objects in heap? Is this the os heap or the heap maintained by the jvm? Why
How can I protect myself? : java security
How do I enable java in firefox?
Explain suspend() method under thread class>
Can a method be static and synchronized?
What is Map,List,hashtable,ArrayList and difference between them??
Are jvm’s platform independent?
How do you check if java is installed on windows command prompt?
What is the difference between swing and awt components?
What is entitymanager in java?
How do I find jre version?