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 actualOp(Object passed); public abstract void actualOp(Object passed, Object passed2); public abstract Object actualOp(); // real component methods public void pushOp(Object passed) { count++; System.out.println("current count: " + count); actualOp(passed); } public void pushOp(Object passed, Object passed2) { count++; System.out.println("current count: " + count); actualOp(passed, passed2); } public Object popOp() { count--; System.out.println("current count: " + count); return actualOp(); } }