1.5.6 Attributes and Instance Variables
A car, besides having capabilities to accomplish tasks, also has attributes, such as its color, its number of doors, the amount of gas in its tank, its current speed and its record of total miles driven (i.e., its odometer reading). Like its capabilities, the car’s attributes are represented as part of its design in its engineering diagrams (which, for example, include an odometer and a fuel gauge). As you drive an actual car, these attributes are carried along with the car. Every car maintains its own attributes. For example, each car knows how much gas is in its own gas ...
- 1.5.6 Attributes and Instance Variables
- from Java™ How To Program (Early Objects), Tenth Edition
- Publisher: Prentice Hall
- Released: February 2014
Share this highlighthttp://www.safaribooksonline.com/a/javatm-how-to/73502/