Discussion :: Threads
-
What will be the output of the program?
public class ThreadTest extends Thread { public void run() { System.out.println("In run"); yield(); system.out.println("Leaving run"); } public static void main(String []argv) { (new ThreadTest()).start(); } }
A.
The code fails to compile in the main() method |
B.
The code fails to compile in the run() method |
C.
Only the text "In run" will be displayed |
D.
The text "In run" followed by "Leaving run" will be displayed |
Be The First To Comment