MCQ Single Best Answer Easy

QWhat role does the "constructor" play in OOP?

ID: #20077 Basic Concept of OOP 91 views
Question Info
#20077Q ID
EasyDifficulty
Basic Concept of OOPTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A Eliminating objects
  • B Exposing internal details of an object
  • C Initializing an object's properties and behaviors
  • D Avoiding code organization
Correct Answer: Option C

Explanation

In OOP, a constructor is responsible for initializing an object's properties and behaviors when the object is created, ensuring a valid initial state.

Share This Question

Challenge a friend or share with your study group.