简体   繁体   English

为什么Java文档中的界面页面具有方法摘要?

[英]Why does interface pages in java documentation have method summary ?

Is a class(for eg: A ) internally defined which implements the interface ? 是否在内部定义了实现接口的类(例如: A )? Does the method summary shown in interface pages of Java Documentation is actually the implementation done by the class A whose implementation is hidden from us ? Java文档的界面页面中显示的方法摘要是否实际上是由A类完成的实现,而其实现对我们来说是隐藏的?

For Example : 例如 :

interface Path { void help();}
class PathImpl implements Path {
  String path;
  PathImpl(String path) { this.path = path; }
  void help(){ System.out.println("Help");}
}

The Path interface documentation has method summary . Path接口文档包含方法摘要。 Is there a hidden class PathImpl which implements every method in Path ? 是否有一个隐藏类PathImpl实现了Path中的每个方法? Is the method summary shown in online documentation actually the method implementations done in PathImpl which is hidden from us ? 在线文档中显示的方法摘要实际上是在PathImpl中完成的方法实现,对我们而言是隐藏的吗?

It just shows the interface of its methods, which every implementer class should follow. 它仅显示了其方法的接口,每个实现者类都应遵循该方法的接口。 For example, if you look at the javadoc for java.util.List, you will see how every method is used, but you don't see the actual implemention, which is left to each implementer class as ArrayList, as far as it respect the interface of List. 例如,如果查看javadoc.util.List的javadoc,将看到每种方法的使用方式,但是没有看到实际的实现,就每个方面而言,它实际上是作为ArrayList留给每个实现者类的List的接口。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么Java有中央API文档,但没有C ++? - Why does Java have a central API documentation, but not C++? 为什么Java的Map接口有一个containsValue(Object)方法,但是没有value-> keys查找? - Why does Java's Map interface have a containsValue(Object) method, but no value->keys lookup? 为什么Java中的DataInput接口没有readUnsignedInt方法 - Why DataInput interface in Java doesn't have readUnsignedInt method Java:为什么这种方法有副作用? - Java: Why does this method have side effects? 为什么 Java 8 Stream 接口没有 min() 无参数版本? - Why Java 8 Stream interface does not have min() no-parameter version? 为什么Java 8中主要托管接口的接口不必公开? - Why does an interface hosting main in Java 8 not have to be public? 为什么具有返回类型的 Java 方法引用与 Consumer 接口匹配? - Why does a Java method reference with return type match the Consumer interface? Java文档覆盖方法不是InheritDoc - Java Documentation Override Method does not InheritDoc Java中的Lombok文档和接口 - Lombok documentation and interface in Java 为什么Collections实用程序类在Java中没有Iterator方法? - why does the Collections utility class does not have a Iterator method in Java?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM