Constructors are functions that are triggered automatically when an object is created. You can also use constructors to require the developer using the class to set initial values for the class. For example, with a Checking class it makes sense to require a developer to set the initial balance for the account. You can have more than one constructor by using method overloading, a technique discussed earlier in this chapter. To add a constructor:
Tips
|