JAVA Threads Which keyword when applied on a method indicates that only one thread should execute the method at a time. static native final synchronized volatile static native final synchronized volatile 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. Compilation fails. An exception is thrown at runtime. "BeginRunEnd" is printed. "BeginEndRun" is printed. "BeginEnd" is printed. Compilation fails. An exception is thrown at runtime. "BeginRunEnd" is printed. "BeginEndRun" is printed. ANSWER DOWNLOAD EXAMIANS APP
JAVA Threads In java a thread can be created by .......... Extending the thread class. Implementing Runnable interface. Both of the above None of these Extending the thread class. Implementing Runnable interface. Both of the above None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Threads Which of the following constructor of class Thread is valid one? Thread(int priority) Thread(Runnable threadOb, int priority) Thread(Runnable threadOb, String threadName) None of these Thread(String threadName, int priority) Thread(int priority) Thread(Runnable threadOb, int priority) Thread(Runnable threadOb, String threadName) None of these Thread(String threadName, int priority) ANSWER DOWNLOAD EXAMIANS APP
JAVA Threads When a class extends the Thread class ,it should override ............ method of Thread class to start that thread. start() go() run() init() start() go() run() init() ANSWER DOWNLOAD EXAMIANS APP
JAVA Threads Which of the following are methods of the Thread class?1) yield()2) sleep(long msec)3) go()4) stop() 1 , 2 and 4 None of these 3 only 1 and 3 1 , 2 and 4 None of these 3 only 1 and 3 ANSWER DOWNLOAD EXAMIANS APP