package CountAPPC; public abstract class CountComponent { int count = 0; // classes to be defined by the extending inner class public abstract Object get_host(); public abstract void expected_pushOp(Object passed); public abstract Object expected_popOp(); // real component methods public void pushOp(Object passed) { count++; System.out.println("current count: " + count); actual_pushOp(passed); } public Object popOp() { count--; System.out.println("current count: " + count); return actual_popOp(); } public abstract void actual_pushOp(Object passed); public abstract Object actual_popOp(); }