设计技巧31: 可以用接口回调,一层一层转接保护的东西

来源:互联网 发布:绘地图软件 编辑:程序博客网 时间:2024/05/16 14:59
public class My{
public interface myInterface{//外部接口
void my()}
}
 
public class You implements My.myInterface{
public intreface youInterface{//转接接口
void you()
}
 
public void my(){//实现调用了外部接口的实现
you();
}
public class Other implements You.youInterface{
 
public void you(){
.......}
}