Java MCQs with answers Page - 9

Here, you will find a collection of MCQ questions on Java. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 831.35K Points
Coach

Q. Which operator is used by Java run time implementations to free the memory of an object when it is no longer needed?

  • (A) delete
  • (B) free
  • (C) new
  • (D) None of the mentioned

A

Admin • 831.35K Points
Coach

Q. Which of these access specifiers must be used for main() method?

  • (A) private
  • (B) public
  • (C) protected
  • (D) None of the mentioned

A

Admin • 831.35K Points
Coach

Q. Which of these is used to access member of class before object of that class is created?

  • (A) public
  • (B) private
  • (C) static
  • (D) protected

A

Admin • 831.35K Points
Coach

Q. The keyword used to create an object

  • (A) class
  • (B) this
  • (C) new
  • (D) malloc

A

Admin • 831.35K Points
Coach

Q. The keyword used to refer the current object

  • (A) class
  • (B) this
  • (C) new
  • (D) malloc

A

Admin • 831.35K Points
Coach

Q. The method which is automatically invoked during garbage collection.

  • (A) destructor
  • (B) terminate()
  • (C) finalize()
  • (D) destroy()

A

Admin • 831.35K Points
Coach

Q. Which class cannot have a subclass in java

  • (A) abstract class
  • (B) parent class
  • (C) final class
  • (D) None of above

A

Admin • 831.35K Points
Coach

Q. Which is the keyword used to inherit a class to another?

  • (A) Inherits
  • (B) extends
  • (C) implements
  • (D) import

A

Admin • 831.35K Points
Coach

Q. The use of final keyword with method definition

  • (A) Supports method overriding
  • (B) implements dynamic method dispatch
  • (C) Prevents method overriding
  • (D) none of these

A

Admin • 831.35K Points
Coach

Q. Identify the type of inheritance when two or more subclasses inherit the properties of a super class.

  • (A) Multiple inheritance
  • (B) Single inheritance
  • (C) Multilevel inheritance
  • (D) Hierarchical inheritance

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ