问题1 :
使用对象适配器实现字符串序列排序。从一个文件中读入一些英文字符串,并且对这些字符串排序。
知识点回顾:
题目中说使用对象适配器,那么什么是对象适配器呢,以及适配器有多少种呢?
首先适配器从实现的方式上面划分为两种分为对象适配器以及类适配器。
类适配器:
所谓的类适配器,是指通过继承的方式完成适配另外一个接口的方式。
public class Adaptee{
doSome();
}
public interface Target{
doSome();
doSomeOther();
}
public class Adapter extends Adaptee implements T