Java MCQs

Sample multiple-choice questions for Java. Answers and short explanations are shown for study. The complete practice bank stays inside the app.

Sample questions

Q1. Which keyword prevents method overriding in Java?

  • A. static
  • B. final ✓
  • C. abstract
  • D. private only

Explanation: final methods cannot be overridden.

Topic: OOP

Q2. Which collection does not allow duplicates?

  • A. ArrayList
  • B. LinkedList
  • C. HashSet ✓
  • D. Vector

Explanation: Set implementations like HashSet disallow duplicates.

Topic: Collections

Related notes

Practice more Java

Continue in the practice app for larger sets and timed modes.

Open application dashboard