Why we call the start
()
method ,which in turn calls the run
()
method ?
Can't we directly make a call to run
() ?
Please give e.g if possible. ?
Why we call the start
()
method ,which in turn calls the run
()
method ?
Can't we directly make a call to run
() ?
Please give e.g if possible. ?
No, you can't. Calling run will execute run() method in the same thread, without starting new thread.
Because start() doesnt just call run(). It starts a new thread and in that thread calls run().
you can't run directly the run() method. Whenever start your thread by using thread.start(), then the run() method has been called and performed the further operation.