Classes normally have methods that manipulate the attributes that belong to object instantiations of the class.
Attributes are realized in the form of variables inside a class declaration. These attributes(variables) are declared inside the class declaration but outside the bodies of the class's methods.
**When each object of a class maintains its own copy of an attribute, the field that represents the attribute is also known as an "instance variable" - each object (instance) of the class has a separate instance of the variable in memory.
Reference: "Java How to Program, by Deitel & Deitel"
No comments:
Post a Comment