Objects and Cllasses
A class defines a concept, and an object represents
the embodiment of a class
A class can be used to create multiple objects
A class is a model or pattern from which objects
are created
For example, the String class is used to define
String objects
The String class was provided for us by the Java
standard class library
But we can also write our own classes that define
specific objects that we need
A class contains data (or variable) declarations
and method declarations
We could write our own Dog class
In Dog, we could define the following data:
• count
• age
• hairColor
We might also define the following methods:
• a Dog constructor
• a bark method
• a wag method
• a add2 method