Site hosted by Angelfire.com: Build your free website today!
 

Instance and Class Members

The members of a class or instance are the variables and methods defined in that class or instance.

Instance member

A variable or method unique for each object

Class member

A variable or method that exists only once for the class regardless of how many objects are created; shared by instances of the class.

Note

In short, class members will always hava the modifier static in front of them.

class Dog {
    static int legs = 4;    //a class members
    static int dogCount = 0;
    static int dogID;
    public String owner;    //instance members
    public String color;
    ....
}