JAVA Threads
Predict the output:public class Test extends Thread{ private int i; public void run(){ i++; } public static void main(String[] args){ Test a = new Test(); a.run(); System.out.print(a.i); a.start(); System.out.print(a.i); }}

Compiler error
IllegalThreadStateException is thrown
Prints
Prints
Prints

ANSWER DOWNLOAD EXAMIANS APP

JAVA Threads
What notifyAll() method do?

Wakes up all threads that are not waiting on this object's monitor
None of these
Wakes up all threads that are waiting on this object's monitor
Wakes up one threads that are waiting on this object's monitor

ANSWER DOWNLOAD EXAMIANS APP

JAVA Threads
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"); }}

Compilation fails.
"BeginEndRun" is printed.
"BeginRunEnd" is printed.
"BeginEnd" is printed.
An exception is thrown at runtime.

ANSWER DOWNLOAD EXAMIANS APP