相同点:
1.都是抽象类,不能被实例化
2.包含抽象方法,实现接口或继承抽象类的子类都必须实现这些抽象方法
3.都有默认方法(JAVA8改进了interface,允许在接口中定义默认方法,必须要用default修饰)
不同点:
1.abstract class 是 is a,interface 是 like a
2.abstract class 只能被单继承,interface 能够被多实现
3.abstract class 只能被继承,interface 能被继承,也能被实现
4.abstract class 可以有成员变量,能实现方法,interface中方法只能声明
5.interface 允许定义类方法(static),而abstract class中不能同时用abstract 和 static 定义方法
6.interface所有方法只能是public,而abstract不一定