< Previous | Contents | Next >

Instantiating Objects

When you create an object, you instantiate it from a class. In fact, specific objects are called instances of the class. In main(), I instantiate two instances of Critter.

Critter crit1; Critter crit2;

As a result, I have two Critter objectscrit1 and crit2.