Classes vs. Objects
It is important to remember that classes are just templates for creating new objects. Objects contain both a state and behavior, and is an instance of a class.
Instances
An instance is a specific version of an object that can differ in numerous ways.
Going back to the previous chapter, Rectangle, Animal, and Vehicle are all classes. These classes, as is, are considered a type, unless you create a specific version of the class.
In essence, if we create two different vehicles they would be specific instances of the Vehicle class.
Remember, An object is an instance of a class.
Examples
Last updated