JAVA Threads When a class extends the Thread class ,it should override ............ method of Thread class to start that thread. start() init() go() run() start() init() go() run() ANSWER DOWNLOAD EXAMIANS APP
JAVA Threads Analyze the following code:public abstract class Test implements Runnable{ public void doSomething() { };} None of these The program compiles fine. The program will not compile because it does not implement the run() method. The program will not compile because it does not contain abstract methods. None of these The program compiles fine. The program will not compile because it does not implement the run() method. The program will not compile because it does not contain abstract methods. ANSWER DOWNLOAD EXAMIANS APP
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 Prints Prints IllegalThreadStateException is thrown Prints Compiler error Prints Prints IllegalThreadStateException is thrown Prints ANSWER DOWNLOAD EXAMIANS APP
JAVA Threads What notifyAll() method do? None of these Wakes up all threads that are not waiting on this object's monitor Wakes up one threads that are waiting on this object's monitor Wakes up all threads that are waiting on this object's monitor None of these Wakes up all threads that are not waiting on this object's monitor 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 What will be the output?class One extends Thread{public void run(){for(int i=0; i<2; i++){System.out.print(i);}}}public class Test{public static void main(String args[]){Test t = new Test();t.call(new One());} public void call(One o){o.start();}} 0 1 Compilation Error 0 0 None of these 0 1 Compilation Error 0 0 None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Threads Which of the following constructor of class Thread is valid one? Thread(Runnable threadOb, String threadName) Thread(Runnable threadOb, int priority) Thread(int priority) Thread(String threadName, int priority) None of these Thread(Runnable threadOb, String threadName) Thread(Runnable threadOb, int priority) Thread(int priority) Thread(String threadName, int priority) None of these ANSWER DOWNLOAD EXAMIANS APP