Advertisements
Advertisements
Question
Consider the following statements:
Computer desktop = new Computer();
Computer Mainframe = new Computer();
Name the objects of the class given above:
Options
Desktop, Mainframe
desktop, Mainframe
Computer, Mainframe
Computer, desktop
MCQ
Advertisements
Solution
desktop, Mainframe
Explanation:
The expression new Computer() creates two objects; the reference (variable) names for those objects are desktop and Mainframe. “Computer” is the class name, not the object name.
shaalaa.com
Is there an error in this question or solution?
2025-2026 (March) Official Board Paper
