Learn Object Oriented Programming
Initialization of an object is guaranteed by providing a special function called the constructor.
If a class has a constructor, the compiler (or runtime environment for JS people) automatically calls the constructor at the point an object is created.
The constructor call is performed automatically (abstracted away) from the end-programmer; it is performed by the compiler at the point the object is defined.
- Book:
Thinking in C++