Skip to content

Commit

Permalink
Merge pull request itwanger#43 from luanheart/master
Browse files Browse the repository at this point in the history
Java8 后接口可以有静态方法
  • Loading branch information
itwanger committed Jan 6, 2023
2 parents b02e534 + 4ff9357 commit 1f486e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/oo/abstract-vs-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ interface Coach {

- 抽象类可以提供成员方法的实现细节,而接口中只能存在public abstract 方法;
- 抽象类中的成员变量可以是各种类型的,而接口中的成员变量只能是public static final类型的;
- 接口中不能含有静态代码块以及静态方法,而抽象类可以有静态代码块和静态方法
- 接口中不能含有静态代码块,而抽象类可以有静态代码块
- 一个类只能继承一个抽象类,而一个类却可以实现多个接口。

2)设计层面上
Expand Down

0 comments on commit 1f486e0

Please sign in to comment.