Multiple choice

Constructors are used to

  1. To build a user interface

  2. To initialize a newly created object

  3. To free memory

  4. to create a sub class

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

Constructors are special methods invoked during the creation of an object to initialize its state.