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