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 does jpa mean?
What if I do not provide the string array as the argument to the method?
In java thread programming, which method is a must implementation for all threads?
What is rxjava2?
Is jdk a compiler?
What is messaging queue in java?
What is type inference? Is type inference available in older versions like java 7 and before 7 or it is available only in java se 8?
How do I install jdk?
What is the difference between map and flatmap in java?
When a thread is created and started, what is its initial state?
there are 67 seats in train . there are only 5 seats in a row and in last row there are only 2 seats. One person can reseve only 5 seat at a time. If person reserving seat , the care is atken that he may get all in row. if seats are not available in row then the arrangement is so that person group get nearby seats. the following class is given public class seat { char name; int seat; boolean isSeatempty } 1.Draw require class digram and object diagram. 2.Write function seatallot(int noofperson) to allocate seat with seat nuber printed for the each name.
What is meant by rest api in java?
What are tlds in java?
How do I enable jvm?
Do I need jdk or jre?