抽象类中至少有一个方法是没有实现的,不能有类的实例,其他与普通类一样了
接口中所有的方法都是空的,所有数据成员强制默认为static final 

解决方案 »

  1.   

    This brings up a question: Should you use an interface or an abstract class? An interface gives you the benefits of an abstract class and the benefits of an interface, so if it’s possible to create your base class without any method definitions or member variables you should always prefer interfaces to abstract classes. In fact, if you know something is going to be a base class, your first choice should be to make it an interface, and only if you’re forced to have method definitions or member variables should you change to an abstract class, or if necessary a concrete class.
    //from thinking in java