[英]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.