Java MCQs with answers Page - 10

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. The keyword used inside a class to refer to its immediate super class is

  • (A) super
  • (B) parent
  • (C) base
  • (D) none of these

A

Admin • 831.35K Points
Coach

Q. Which of the following is true in the case of abstract class

  • (A) Abstract constructors cannot be created.
  • (B) Abstract classes can not be inherited.
  • (C) An abstract class contains only abstract methods.
  • (D) All of the above.

A

Admin • 831.35K Points
Coach

Q. Which of these keywords are used to define an abstract class?

  • (A) abst
  • (B) abstract
  • (C) Abstract
  • (D) abstract class

A

Admin • 831.35K Points
Coach

Q. If a class inheriting an abstract class does not define all of its function then it will be known as?

  • (A) abstract
  • (B) A simple class
  • (C) Static class
  • (D) None of the mentioned

A

Admin • 831.35K Points
Coach

Q. Which of these is not a correct statement?

  • (A) Every class containing abstract method must be declared abstract.
  • (B) Abstract class defines only the structure of the class not its implementation.
  • (C) Abstract class can be initiated by new operator
  • (D) Abstract class can be inherited.

A

Admin • 831.35K Points
Coach

Q. Which method defined in Integer class can be used to convert a whole number in string type to primitive int type.

  • (A) valueOf()
  • (B) intValue()
  • (C) parseInt()
  • (D) getInteger()

A

Admin • 831.35K Points
Coach

Q. The method sqrt() is defined in the class

  • (A) System
  • (B) Root
  • (C) Math
  • (D) Arithmetic

A

Admin • 831.35K Points
Coach

Q. A primitive data type can be passed as an argument into a method

  • (A) By value
  • (B) by reference
  • (C) both a & b
  • (D) none of these

A

Admin • 831.35K Points
Coach

Q. Which of these is used as default for a member of a class if no access specifier is used for it?

  • (A) private
  • (B) public
  • (C) public, within its own package
  • (D) protected

A

Admin • 831.35K Points
Coach

Q. Which of these keywords is used to refer to member of base class from a sub class?

  • (A) upper
  • (B) super
  • (C) this
  • (D) None of the mentioned

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