摘要:
适配器模式主要是为了在不能改变现有类的情况下,将一个类转换成另一种类,让他可以适应一个通用的接口public interface Printable { void printSth();}public class Printer implements Printable { @Override public void printSth() { System.out.println("I can print text"); }}public class Photogragher { public void printPhoto(){ Sy... 阅读全文
posted @ 2012-11-03 05:17
ZimZz
阅读(228)
评论(0)
推荐(0)
摘要:
阅读全文
posted @ 2012-11-03 04:00
ZimZz
阅读(298)
评论(0)
推荐(0)