Question 1 of 25
Hints left: 3
Q1
What will be the output of the following program code? public class Test implements Runnable{ public static void main(String[] args){ Thread t = new Thread(this); t.start(); } public void run(){ System.out.println("test"); } }
Q2
What is the purpose of the setPriority() method in Java threads?
Q3
In Java, what is the difference between a thread's priority and its thread group's maximum priority?
Q4
What is the purpose of the yield() method in Java threads?
Q5
In Java, which class is used to create and manage thread groups?
Q6
In Java, what is a daemon thread?
Q7
How can you handle exceptions in Java threads?
Q8
Which of the following constructor of class Thread is valid one?
Q9
How can you check if a thread is still running in Java?
Q10
In Java, what is the purpose of the interrupt() method in threads?
Q11
In Java, what is the purpose of the isInterrupted() method in threads?
Q12
What is the purpose of the getState() method in Java threads?
Q13
What is the result of calling the setDaemon(true) method on a running thread in Java?
Q14
What is a deadlock in multithreading?
Q15
In Java, what is the purpose of the sleep() method in threads?
Q16
When a class extends the Thread class ,it should override ............ method of Thread class to start that thread.
Q17
What is the purpose of the isDaemon() method in Java threads?
Q18
In Java, what is the maximum thread priority value?
Q19
In Java, can you force a thread to stop its execution using the stop() method?
Q20
In java a thread can be created by ..........
Q21
How can you prevent multiple threads from accessing a critical section of code simultaneously in Java?
Q22
In Java, what happens when a thread encounters an uncaught exception and terminates abruptly?
Q23
In Java, can you directly access the run() method of a Thread object?
Q24
What is the purpose of the join() method in Java threads?
Q25
Which keyword is used to declare a synchronized method in Java?