English

Which of the following is a valid statement? (a) A class can have many objects (b) A class can have only one object (c) A class cannot have any object (d) A class can have only two objects

Advertisements
Advertisements

Question

Which of the following is a valid statement?

Options

  • A class can have many objects

  • A class can have only one object

  • A class cannot have any object

  • A class can have only two objects

MCQ
Advertisements

Solution

A class can have many objects

Explanation:

A class is simply a reusable blueprint or template. Once you write a class, you can use the new keyword to create an unlimited number of unique objects from it. Each object acts as an independent instance with its own separate data values while sharing the same structure.

shaalaa.com
  Is there an error in this question or solution?
Chapter 5: Library Classes - Exercises [Page 133]

APPEARS IN

Rupa Pandit Computer Applications [English] Class 10 ICSE
Chapter 5 Library Classes
Exercises | Q 1. (vi) | Page 133
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×