



A class is a blueprint that defines the variables and the methods common to all objects of a certain kind. A class can be visually represented like this (diagram from The Java Tutorial):

A class can define class variables and class methods.
A class variable is a data item associated with a particular class as a whole--not with particular instances of the class. It contains information that is shared by all instances of the class. Class variables are defined in class definitions.
A class method is a method that is called without reference to a particular object - you can invoke a class method directly from the class. They affect the class as a whole, not a particular instance of the class.
An object is an instance of a class. It has state, behaviour and identity. A software object maintains its state in one or more variables. A variable is an item of data named by an identifier. A software object implements its behaviour with methods. A method is a function (subroutine) associated with an object.
When you create an instance of a class, the system allocates enough memory for the object and all its instance variables. Each instance gets its own copy of all the instance variables defined in the class.
An instance variable is any item of data that is associated with a particular object. Each instance of a class (an object) has its own copy of the instance variables defined in the class.
An instance method is any method that is called with respect to an instance of a class – instance methods are called using objects that are declared within your program.



