How to use Constructors? Two ways to initialize an object by using a constructor: An Explicit call to constructor: Time t1 = Time(12, 24, 10); An Implicit call to constructor: Time t1(12, 24, 10); Constructor is called whenever you create an object of a class. The constructor creates object. There is no object until the constructor finishes it’s work. You can’t call a constructor with an object. www.learnbywatch.com |
[email protected]