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); }}

Prints
Compiler error
Prints
IllegalThreadStateException is thrown
Prints

ANSWER DOWNLOAD EXAMIANS APP

JAVA Threads
Given the code. What will be the result?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"); }}

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

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 one threads that are waiting on this object's monitor
Wakes up all threads that are waiting on this object's monitor

ANSWER DOWNLOAD EXAMIANS APP

JAVA Threads
Analyze the following code:public abstract class Test implements Runnable{ public void doSomething() { };}

The program compiles fine.
None of these
The program will not compile because it does not contain abstract methods.
The program will not compile because it does not implement the run() method.

ANSWER DOWNLOAD EXAMIANS APP