完整的参考/******start******/class Waiter implements Bell { public Waiter(int n) { System.out.printf("Waiter %d receives a bell ring.\n",n); } public void answer() { System.out.printf("the customer is served."); }}class Customer { Bell bell; public Customer(Bell b) { bell=b; } public void served() { bell.answer(); }}/******end******/