Constructor Call Example
- BankAccount harrysChecking = new BankAccount(1000);
- Create a new object of type BankAccount
- Call the second constructor (since a construction parameter
is supplied)
- Set the parameter variable initialBalance to 1000
- Set the balance instance field of the newly created
object to initialBalance
- Return an object reference, that is, the memory location of
the object, as the value of the new expression
- Store that object reference in the harrysChecking
variable