Skip to content
16. Which of these classes are not part of Java’s collection framework?
- A) HashMap
- B) HashSet
- C) TreeMap
- D) Hashtable
17. Which of the following is not a valid keyword in Java?
- A) static
- B) volatile
- C) interface
- D) overload
18. In which of the following scenarios would you use the transient keyword in Java?
- A) To prevent serialization of a field
- B) To prevent a method from being overridden
- C) To create a constant variable
- D) To define a global variable
19. Which of the following exceptions is a checked exception in Java?
- A) NullPointerException
- B) ArrayIndexOutOfBoundsException
- C) FileNotFoundException
- D) ArithmeticException
20. Which of the following methods belongs to the Thread class?
- A) sleep()
- B) notify()
- C) wait()
- D) exit()
21. Which of the following is the correct way to declare a constant in Java?
- A) final int MAX_VALUE = 100;
- B) const int MAX_VALUE = 100;
- C) static int MAX_VALUE = 100;
- D) constant int MAX_VALUE = 100;
22. Which method is used to terminate a thread in Java?
- A) terminate()
- B) stop()
- C) abort()
- D) exit()
23. What is the default value of a boolean variable in Java?
- A) true
- B) false
- C) 1
- D) null
24. Which keyword is used to refer to the current object in Java?
- A) self
- B) this
- C) super
- D) object
25. Which of these classes can be used for reading input from a user in Java?
- A) Scanner
- B) FileReader
- C) BufferedReader
- D) InputStream
2 thoughts on “Java Aptitude MCQ Questions with Answers for Freshers”