iGET

Java Programming - MCQ Practice Questions

Practice free Java Programming multiple-choice questions with detailed answers and explanations. Perfect for competitive exam preparation.

951 questions | 100% Free

Q.1Easy

Which interface must be implemented to create a thread in Java?

Q.2Easy

Which method is used to stop a thread in Java?

Q.3Easy

Which method is called to make a thread wait until another thread completes?

Q.4Easy

Which of the following is a valid way to create a thread in Java?

Q.5Easy

In Java multithreading, which method is used to pause the execution of a thread for a specified number of milliseconds without releasing locks?

Q.6Easy

Which of the following statements about the notify() method is correct?

Q.7Easy

Which exception is thrown when a thread is interrupted while waiting?

Q.8Easy

What is the return type of the join() method in Java threading?

Q.9Easy

Which of the following best describes the purpose of the Runnable interface in Java?

Q.10Easy

Which of the following statements about Java threads is correct?

Q.11Easy

What is the primary purpose of the volatile keyword in Java multithreading?

Q.12Easy

Which of the following will cause a deadlock situation?

Q.13Easy

Which collection class is thread-safe without explicit synchronization?

Q.14Easy

Which method is used to prevent race conditions by allowing only one thread to access a resource at a time?

Q.15Easy

Which of the following collections is thread-safe in Java?

Q.16Easy

What is the output of the following code? Thread t = new Thread(() -> System.out.println(Thread.currentThread().getName())); t.start();

Q.17Easy

Which method must be implemented to create a thread in Java?

Q.18Easy

What is the difference between start() and run() methods in threading?

Q.19Easy

Which of the following thread states is NOT a valid Java thread state?

Q.20Easy

Which of the following methods will cause a thread to release all locks it holds while waiting?