







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!








public static void printObject(Object x) { String s = x.toString(); System.out.printf("%s\n", s); }
●
● (^) sometimes a class is designed to be subclassed ● (^) the designer of the superclass may want to require the subclass to provide a specific method ● (^) this method is called abstract in the superclass
●
● (^) each subclass of BankAccount, e.g SavingsAccount and CheckingAccount, provides the deposit, withdrawal, getBalance, and monthEnd methods
● (^) in this example, both uses of super are optional, since SavingsAccount does not override getBalance and deposit
●
●
●