posted 23 years ago
There is a little more to it than that Fawad. Class level variables are static, meaning that if there are 20 instances of a class, they all share that variable. So if object A changes a class variable to 20, then it will be 20 when you reference it from object B as well.
Instance variables belong to an instance of a class. Every object holds it own value. So if object A changes its instance variable to 20, object B will not have its instance variable changed also.
The third type is local variables, and those are variables that are inside of methods.
Bill