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. |
Which of these operators is used to allocate memory for an object? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: Operator new dynamically allocates memory for an object and returns a reference to it. This reference is address in memory of the object allocated by new. |
2. |
Which method can be defined only once in a program? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: main() method can be defined only once in a program. Program execution begins from the main() method by java’s run time system. |
3. |
Which operator is used by Java run time implementations to free the memory of an object when it is no longer needed? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Explanation: Java handles deallocation of memory automatically, we do not need to explicitly delete an element. Garbage collection only occurs during execution of the program. When no references to the object exist, that object is assumed to be no longer needed, and the memory occupied by the object can be reclaimed. |
4. |
What is the process of defining a method in terms of itself, that is a method that calls itself? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Explanation: None. |
5. |
What is the process by which we can control what parts of a program can access the members of a class? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: None. |
6. |
Which of the following statements are incorrect? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Explanation: All objects of class share same static variable, when object of a class are declared, all the objects share same copy of static members, no copy of static variables are made. |
7. |
Which of these method of String class can be used to test to strings for equality? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Explanation: None. |
8. |
Which of these is correct way of inheriting class A by class B? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: None. |
9. |
Which of these is correct way of calling a constructor having no parameters, of superclass A by subclass B? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Explanation: None. |
10. |
Which of these keywords can be used to prevent inheritance of a class? |
|||||||||||||||||||
|