Introduction to OOP: Chapter 4: Messages, Instances, and Initialization: [next] [previous] [audio] [real] [text]

Invoking Constructors

A constructor is never directly invoked by the user. Instead, arguments to the constructor are provided in a declaration statement (or a new) statement.



	Card aceOfSpace (Spade, 0); // static allocation

	Card * aCard = new Card(Diamond, 7); // dynamic allocation
Intro OOP, Chapter 4, Slide 13