English

A constructor gets activated when ______.

Advertisements
Advertisements

Question

A constructor gets activated when ______.

Options

  • it is invoked

  • an object of the class is created

  • the program is compiled

  • never

MCQ
Fill in the Blanks
Advertisements

Solution

A constructor gets activated when an object of the class is created.

Explanation:

A constructor is a special method of a class that is automatically called when an object is created. It is mainly used to initialize the data members of the object.

shaalaa.com
  Is there an error in this question or solution?
Chapter 4: Constructors - Exercises [Page 114]

APPEARS IN

Rupa Pandit Computer Applications [English] Class 10 ICSE
Chapter 4 Constructors
Exercises | Q 1. (i) | Page 114
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×