Multiple choice technology programming languages

How many objects of a given class can there be in a program?

  1. One per defined class.

  2. One per constructor definition.

  3. As many as the program needs.

  4. One per program

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

A class is a template - you can create as many objects (instances) of a class as your program needs, limited only by available memory. There's no built-in limit of one object per class, constructor, or program. Objects are created using the 'new' keyword and can be instantiated repeatedly.