()
| 21 | public class Detergent extends Cleanser { |
| 22 | // Change a method: |
| 23 | @Override public void scrub() { |
| 24 | append(" Detergent.scrub()"); |
| 25 | super.scrub(); // Call base-class version |
| 26 | } |
| 27 | // Add methods to the interface: |
| 28 | public void foam() { append(" foam()"); } |
| 29 | // Test the new class: |