CHAPTER 31—Designing a Class
(Miles per Gallon)
This chapter contains another example of designing a class,
and then using objects of that type.
The class is named Car,
and is a simple
miles-per-gallon calculator.
Chapter Topics:
- How classes are documented.
- Writing a class definition.
- Instance variables.
- Using instance variables in a method.
- Constructors.
- Constructor parameter lists.