Java普通类,抽象类和接口的区别?The difference between ordinary class, abstract class and interface?
Abstract class have abstract and concrete methods, but interface can only have abstract methods.
Regular class use class keyword to claim but abstract class us abstract class, and the interface uses the keyword: interface.
Regular class can extend regular class and abstract class, and can implement interface
And like regular class, the abstract class can do the same…
But interface can only extends interfaces.
We can implement multiple interface but we can only extend one regular class or abstract class.
总而言之 抽象类和普通类并没有本质区别,两者都能继承普通类和抽象类 然后实现接口
但是接口只能继承接口,不能继承任何类。

浙公网安备 33010602011771号