Classes and Objects 03 Flashcards

1
Q

What is the purpose of a ‘constructor’ method?

A

A constructor is a special member used to create and instance in a class. it is called whenever object of that class is created. They are used to initialise data field in object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly