English, asked by shukladewanshi860, 8 months ago


What will happen if we call run() directly, without start() ?
(A) Program will give a

compilation error
(B) Nothing will happen both the methods are same
(C) Runtime error
(D) thread won't be allocated a new call stack, and start runnin​

Answers

Answered by shrutijha0804
5

Answer:

thread won't be allocated a new call stack, and start runnin

Answered by steffiaspinno
0

(D) The thread won't be allocated a new call stack, and start running.

Using run() directly won't give a compilation error as it and start() aren't functionally and syntactically dependent on each other.

However, invoking run() directly from the main thread without using start() will make sure that the invoked run() method will go onto the current call stack and will not at the beginning of a new call stack, which is counterintuitive in many cases.

Similar questions