/* The purpose of this class is to provide a * honk implementation once, since it is essentially * the same in every implementation. * Note that because this is an abstract class, it * cannot be instantiated with 'new'. */ abstract class AbstractHonkable implements Honkable { protected String honkTxt; public String honk(int n) { String s = ""; for (int i = 0; i < n; i++) { s += honkTxt; } return s; } }