Java Reference
In-Depth Information
Next, create a subclass of
Book
, called
ExtBook
, and a class called
ProtectDemo
that
uses
ExtBook
.
ExtBook
adds a field that stores the name of the publisher and several ac-
cessor methods. Both of these classes will be in their own package called
bookpackext
.
They are shown here: