Q50
What will be the output after compiling and executing the following code? public class Test implements Runnable public static void main(String[] args) throws InterruptedException Thread a = new Thread(new Test()); a.start(); System.out.print("Begin"); a.join(); System.out.print("End"); public void run() System.out.print("Run");
A.
Compilation fails.
B.
An exception is thrown at runtime.
C.
"BeginRunEnd" is printed.
AnswerD.
"BeginEndRun" is printed.
E.
"BeginEnd" is printed.
Answer: Option C
Solution
Answer: Option C
No explanation is given for this question Let's Discuss on Board