Java Reference
In-Depth Information
Note the use of the
protected
access modifier on the
decodeColor
method.
By making this method
protected
it can be accessed in the current class
or in a subclass but is not externally visible. We look in detail at what
Exercise 3.1
: Starting with the
Vehicle
class from the exercises in
capability for counting the number of seats available in the car and the
number currently occupied. Provide a new
main
method in
PassengerVe-
hicle
to create a few of these objects and print them out.