KnowledgeBoat Logo
|

Computer Applications

Consider the following statements:

Computer desktop = new Computer();
Computer Mainframe = new Computer();

Name the objects of the class given above:

  1. Desktop, Mainframe
  2. desktop, Mainframe
  3. Computer, Mainframe
  4. Computer, desktop

Java Classes

3 Likes

Answer

desktop, Mainframe

Reason — In the given statements, Computer is the class name, while desktop and Mainframe are the object names (variables that store object references). Therefore, the objects of the class are desktop and Mainframe.

Answered By

1 Like


Related Questions