Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修改接口静态方法的描述 #393

Closed
wants to merge 652 commits into from
Closed

修改接口静态方法的描述 #393

wants to merge 652 commits into from

Conversation

tonycody
Copy link

备注:在JDK8中,接口也可以定义静态方法,可以直接用接口名调用。实现类和实现是不可以调用的。如果同时实现两个接口,接口中定义了一样的默认方法,必须重写,不然会报错。(详见issue:[https://github.com/Snailclimb/JavaGuide/issues/146](https://github.com/Snailclimb/JavaGuide/issues/146))

`备注:(JDK8)

  • 接口内可以声明包含具体实现的静态方法,通过接口名.静态方法名直接调用。实现类及其子类不可以直接调用或重写。
  • 如果同时实现两个接口,接口中定义了一样的默认方法,则必须重写,不然会报错。(详见issue:接口和抽象类的区别是什么 #146)`

Copy link
Owner

@Snailclimb Snailclimb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

抱歉, 请fork master分支的内容进行修改。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.