Hi Friends,
What is the result of compiling and executing the following
Java class:
public class ThreadTest extends
Thread {
public void run() {
System.out.println("In run");
suspend();
resume();
System.out.println("Leaving run");
}
public static void main(
String args []) {
(new ThreadTest()).start();
}
}
A> Compilation will fail in the method main.
B> Compilation will fail in the method run.
C> A warning will be generated for method run.
D> The string "In run" will be printed to standard out.
E> Both strings will be printed to standard output.
F> Nothing will happen.
Select the most appropriate answer.
The ans. given is D. I agree with it but resume() method should also play its part and hence E ption should be the ans.
Please correct me if I am wrong.
Jyotsna