/** * Created by hero on 16-4-2. */ public interface Subject { public void interview(); } /** * Created by hero on 16-4-2. */ public class Boss implements Subject { private String interviewee; public Boss(String interviewee) { this.interviewee = interviewee; } @Override public void interview() { System.out.println("boss interviews " + interviewee); } } /** * Created by hero on 16-4-2. */ public class Secretary implements Subject { private Boss boss; public Secretary(String interviewee) { boss = new Boss(interviewee); } @Override public void interview() { boss.interview(); } } public class Main { public static void main(String[] args) { Secretary secretary = new Secretary("小明"); secretary.interview(); } }