Title | |
---|---|
What is the stored in the object obj in following lines of codeWhat is the stored in the object obj in following lines of code? box obj;
The answer is:
B. NULL
|
|
Which of these keywords is used to make a classWhich of these keywords is used to make a class?
The answer is:
A. class
|
|
Which of the following is a valid declaration of an object of class BoxWhich of the following is a valid declaration of an object of class Box?
The answer is:
A. Box obj = new Box();
|
|
Which of these operators is used to allocate memory for an objectWhich of these operators is used to allocate memory for an object?
The answer is:
C. new
|
|
Which of these statement is incorrectWhich of these statement is incorrect
The answer is:
A. Every class must contain a main() method
|
|
What is the output of this programWhat is the output of this program?
The answer is:
C. Compilation error
|
|
Which of the following statements is correctWhich of the following statements is correct
The answer is:
A. Public method is accessible to all other classes in the hierarchy
|
|
What is the output of this programWhat is the output of this program?
The answer is:
B. 200
|
|
What is the output of this programWhat is the output of this program?
The answer is:
A. 1
|
|
What is the output of this programWhat is the output of this program?
The answer is:
D. classname@hashcode in hexadecimal form
|
|
What is the return type of a method that does not return any valueWhat is the return type of a method that does not return any value?
The answer is:
C. void
|
|
What is the process of defining more than one method in a class differentiated by method signatureWhat is the process of defining more than one method in a class differentiated by method signature?
The answer is:
B. Function overloading
|
|
Which of the following is a method having same name as that of it’s classWhich of the following is a method having same name as that of it’s class?
The answer is:
D. constructor
|
|
Which method can be defined only once in a programWhich method can be defined only once in a program?
The answer is:
A. main method
|
|
What is the output of this programWhat is the output of this program?
The answer is:
C. 6
|
|
What is the output of this programWhat is the output of this program?
The answer is:
B. True
|
|
Which keyword is used by the method to refer to the object that invoked itWhich keyword is used by the method to refer to the object that invoked it?
The answer is:
D. this
|
|
Which of the following is a method having same name as that of its classWhich of the following is a method having same name as that of its class?
The answer is:
D. constructor
|
|
Which operator is used by Java run time implementations to free the memory of an object when it is no longer neededWhich operator is used by Java run time implementations to free the memory of an object when it is no longer needed?
The answer is:
D. none of the mentioned
|
|
Which function is used to perform some action when the object is to be destroyedWhich function is used to perform some action when the object is to be destroyed?
The answer is:
A. finalize()
|
MCQs
Views
Best Answers
Points