Object-Oriented Programming (OOP)
In computer science, Constructor refers to which of the following?
- A. A blueprint that defines the properties and behaviors that objects created from it will have.
- B. An OOP principle that bundles data and methods together while restricting direct access to some components.
- C. A special method automatically called when an object of a class is created, used to initialize it. ✓
- D. The ability to define multiple methods with the same name but different parameters in a class.
Correct answer
C. A special method automatically called when an object of a class is created, used to initialize it.
Explanation
Constructor refers to a special method automatically called when an object of a class is created, used to initialize it.