Java MCQs with answers Page - 25

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 • 832.01K Points
Coach

Q. Why we use array as a parameter of main method

  • (A) It is syntax
  • (B) Can store multiple values
  • (C) Both of above
  • (D) None of above

A

Admin • 832.01K Points
Coach

Q. What is process of defining two or more methods within same class that have same name but different parameters declaration?

  • (A) Method overloading
  • (B) Method overriding
  • (C) Method hiding
  • (D) None of the mentioned

A

Admin • 832.01K Points
Coach

Q. Which of these is correct about passing an argument by call-by-value process?

  • (A) Copy of argument is made into the formal parameter of the subroutine.
  • (B) Reference to original argument is passed to formal parameter of the subroutine.
  • (C) Copy of argument is made into the formal parameter of the subroutine and changes made on parameters of subroutine have effect on original argument.
  • (D) Reference to original argument is passed to formal parameter of the subroutine and changes made on parameters of subroutine have effect on original argument.

A

Admin • 832.01K Points
Coach

Q. What is the process of defining a method in terms of itself that is a method that calls itself?

  • (A) Polymorphism
  • (B) Abstraction
  • (C) Encapsulation
  • (D) Recursion

A

Admin • 832.01K Points
Coach

Q. Which of the following statements are incorrect?

  • (A) Default constructor is called at the time of declaration of the object if a constructor has not been defined.
  • (B) Constructor can be parameterized.
  • (C) Finalize() method is called when a object goes out of scope and is no longer need
  • (D) None of the above

A

Admin • 832.01K Points
Coach

Q. What is the stored in the object obj in following lines of code? box obj;

  • (A) Memory address of allocated memory of object.
  • (B) NULL
  • (C) Any arbitrary pointer
  • (D) Garbage

A

Admin • 832.01K Points
Coach

Q. Which of this statement is incorrect?

  • (A) Every class must contain a main() method.
  • (B) Applets do not require a main() method at all.
  • (C) There can be only one main() method in a program.
  • (D) main() method must be made public.

A

Admin • 832.01K Points
Coach

Q. Which of the following statements is correct?

  • (A) Public method is accessible to all other classes in the hierarchy
  • (B) Public method is accessible only to subclasses of its parent class
  • (C) Public method can only be called by object of its class.
  • (D) Public method can be accessed by calling object of the public class.

A

Admin • 832.01K Points
Coach

Q. Program which executes applet is known as

  • (A) applet engine
  • (B) virtual machine
  • (C) JVM
  • (D) None of above

A

Admin • 832.01K Points
Coach

Q. You read the following statement in a Java program that compiles and executes. submarine.dive(depth); What can you say for sure?

  • (A) Depth must be an int
  • (B) Dive must be a method.
  • (C) Dive must be the name of an instance fie
  • (D) None of the above

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