

MCQOPTIONS
Saved Bookmarks
1. |
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 |
Answer» E. | |