December 1999
Intermediate to advanced
816 pages
20h 27m
English
It's common, when you create subclasses from a base class, to need to change the way a specific method is implemented. If your subclass modifies the method signature or behavior of a method that it inherits from a superclass (within certain limits), we call that method in the subclass an "overridden method." Let's look at an example in Listing 5.10.
public class Book { public GregorianCalendar dueDate; public boolean checkOut() { dueDate = new GregorianCalendar(new SimpleTimeZone(-8 * 60 * 60 * 1000, zoneID)); // This is insufficient code // for making a proper GregorianCalendar // object, but it will serve ... |
Read now
Unlock full access