A constructor is a special method of a class or structure in object-oriented programming that initializes a newly created object of that type . Whenever an object is created, the constructor is called automatically.
Read moreWhat should not be in a constructor?
Don’t use init()/cleanup() members . If you have to call init() every time you create an instance, everything in init() should be in the constructor. The constructor is meant to put the instance into a consistent state which allows any public member to be called with a well-defined behavior.
Read more