Instruction
- Total number of questions : 10.
- Time alloted : 10 minutes.
- Each question carry 1 mark.
- No Negative marks
- DO NOT refresh the page.
- All the best :-).
1. |
What is the stored in the object obj in following lines of code? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: Memory is allocated to an object using new operator. box obj; just declares a reference to object, no memory is allocated to it hence it points to NULL. |
2. |
What is the return type of a method that does not returns any value? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: Return type of an method must be made void if it is not returning any value. |
3. |
What is the return type of Constructors? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Explanation: Constructors does not have any return type, not even void. |
4. |
What is process of defining two or more methods within same class that have same name but different parameters declaration? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: Two or more methods can have same name as long as their parameters declaration is different, the methods are said to be overloaded and process is called method overloading. Method overloading is a way by which Java implements polymorphism. |
5. |
Which of these access specifiers must be used for main() method? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: main() method must be specified public as it called by Java run time system, outside of the program. If no access specifier is used then by default member is public within its own package & cannot be accessed by Java run time system. |
6. |
Arrays in Java are implemented as? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: None. |
7. |
String in Java is a? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: None. |
8. |
Which of these keyword must be used to inherit a class? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Explanation: None. |
9. |
Which of these keyword can be used in subclass to call the constructor of superclass? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: None. |
10. |
Which of these class is superclass of every class in Java? |
|||||||||||||||||||
|