摘要: 1.String,StringBuffer和StringBuilder区别String为immutable,StringBuffer为线程安全,StringBuilder非线程安全2.如何对一已知的List中的对象排序Collections.sort<List<T> list, Comparator<? super T> c>对象实现Comparator接口的compare(T o1, T o2)方法3.Java API中Arrays.sort(int[] a)排序算法是如何实现的if(len < 7){ //Insertion sort on sma 阅读全文
posted @ 2012-04-24 20:09 qiangzhu 阅读(192) 评论(0) 推荐(0) 编辑
摘要: The Facade Pattern provides a unified interface to a set of interfaces in a subsystem. Facade defines a higher-levelinterface that makes the subsystem easier to use.A facade not only simplifies an interface, it decouples a client from a subsystem of components.Facades and adapters may wrap multiple 阅读全文
posted @ 2012-04-24 16:35 qiangzhu 阅读(431) 评论(0) 推荐(0) 编辑
摘要: The Adapter Pattern converts the interface of a class into another interface the clients expect.Adapter lets classedwork togetherthat couldn't otherwise because of imcompatible interfaces.Object and class adaptersclass diagramThe only difference is that with class adapter we subclass the Target 阅读全文
posted @ 2012-04-24 16:01 qiangzhu 阅读(511) 评论(0) 推荐(0) 编辑