| 5 | // Inheritance syntax & properties |
| 6 | |
| 7 | class Cleanser { |
| 8 | private String s = "Cleanser"; |
| 9 | public void append(String a) { s += a; } |
| 10 | public void dilute() { append(" dilute()"); } |
| 11 | public void apply() { append(" apply()"); } |
| 12 | public void scrub() { append(" scrub()"); } |
| 13 | @Override public String toString() { return s; } |
| 14 | public static void main(String[] args) { |
| 15 | Cleanser x = new Cleanser(); |
| 16 | x.dilute(); x.apply(); x.scrub(); |
| 17 | System.out.println(x); |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | public class Detergent extends Cleanser { |
| 22 | // Change a method: |
nothing calls this directly
no outgoing calls
no test coverage detected