Sail E0 Webinar
Question
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"); }}
Options:
A .  "BeginEndRun" is printed.
B .  "BeginEnd" is printed.
C .  Compilation fails.
D .  An exception is thrown at runtime.
E .  "BeginRunEnd" is printed.
Answer: Option E

Submit Your Solution Below and Earn Points !
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers