Here's some of it. I'm looking it up as I go along.
Instance variables Each object has its own copy of the variable.
If the value is changed, it's changed for that instance only.
Example:
int myVar = 12; Class Variables Also called Static variables. Declared with the
static keyword.
There's only one copy available, and it's shared by all objects in the class.
If the value is changed, all objects "see" the new value.
Example:
static int x = 12; Another example is
Math.PI - which will access the static variable PI (3.14....) in the Math class.
Class Methods Also called Static methods. Declared with the
static keyword.
Can be executed even when no objects exist.
Class methods can not refer to instance variables, only to class variables.
Example:
Math.random() will execute the random method in the Math class.
Instance Methods Can only be called by an object.
Example: object myObj would call method aMethod like this:
myObj.aMethod(); Like I said, that's just some of it. I'm glad you asked this, because it's something I've been trying to understand, too, and writing it out like this (provided I've gotten it correct!) helps.
Susan
[This message has been edited by Susan Delph (edited May 02, 2001).]