Home / Programming Questions / JAVA MCQs / Page 10

JAVA MCQs with answers Page - 10

Dear candidates you will find MCQ questions of JAVA here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Share your questions by clicking Add Question

R

Ram Sharma • 178.08K Points
Coach

Q. What is 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

R

Ram Sharma • 178.08K Points
Coach

Q. Which of the following is a valid declaration of an object of class Box?

(A) Box obj = new Box();
(B) Box obj = new Box;
(C) obj = new Box();
(D) new Box obj;

R

Ram Sharma • 178.08K Points
Coach

Q. Name the keyword that makes a variable belong to a class, rather than being defined for each instance of the class.

(A) static
(B) final
(C) abstract
(D) public

R

Ram Sharma • 178.08K Points
Coach

Q. Variables declared with in a class are called

(A) Identifier
(B) local variable
(C) instance variable
(D) global variable

R

Ram Sharma • 178.08K Points
Coach

Q. Variables declared within a method or block are called

(A) Static variable
(B) local variable
(C) instance variable
(D) global variable

R

Ram Sharma • 178.08K Points
Coach

Q. Defining methods with same name and different no. of parameters are called

(A) Method overriding
(B) method overloading
(C) Dynamic method dispatch
(D) none of the above

R

Ram Sharma • 178.08K Points
Coach

Q. _________ is used to initialize objects.

(A) Methods
(B) arguments
(C) constructors
(D) new keyword

R

Ram Sharma • 178.08K Points
Coach

Q. What is the return type of Constructors?

(A) int
(B) float
(C) void
(D) None of the mentioned

Login

Forgot username? click here

Forgot password? Click here

Don't have account? Register here.