public abstract interface 等效于 public interface

public interface 为隐式申明

在JDK文档中提到:

1>Think of an interface as a 100-percent abstract class.

2>深入的描述:

Typing in the abstract modifier is considered redundant; interfaces are implicitly abstract whether you type abstract or not. You just need to know that both of these declarations are legal, and functionally identical:

public abstract interface Rollable { }
public interface Rollable { }

The public modifier is required if you want the interface to have public rather than default access.

一句话描述: 在Interface申明时含不含abstract都一样!

//////////////////////////////////////////////////////////以下为错误描述//////////////////////////////////////////////////////

abstract interface 和单纯的interface的区别是:

   Class 和 Class 之间是 extends

InterfaceInterface 之间是 extends

Class 和 Interface 之间是 implements

Interface 和 abstract Interface 之间仅仅只能被你自己定义的接口extends,不可能implements, implements是Class和Interface之间的"专利"

一句话 就是 abstract interface 只能被interface继承,不能直接被类实现

相关文章:

  • 2022-12-23
  • 2021-11-02
  • 2021-11-04
  • 2021-08-19
  • 2021-10-19
猜你喜欢
  • 2021-05-17
  • 2021-06-10
  • 2021-09-06
  • 2021-06-01
  • 2021-07-17
  • 2021-06-28
  • 2021-11-16
相关资源
相似解决方案