[英]What does it mean to extend a Vector<Object> in java?
For example, I have a class that says 例如,我有一堂课说
public class KeyList extends Vector<Object> {
}
but it never specifically creates a new Vector of any kind. 但它从未专门创建任何新的Vector。 This is part of an implementation of Eliza that I found online
这是我在网上找到的Eliza实施的一部分
extends
means that KeyList
is-a Vector
. extends
装置,其KeyList
是-一个 Vector
。 It does not (necessarily) mean that KeyList
has-a Vector
. 它不(一定)是指
KeyList
具有-一个 Vector
。
See The Java Tutorial for more, specifically What Is Inheritance? 有关更多信息,请参见Java教程,尤其是什么是继承? and the Inheritance section .
和继承部分 。
It is about inheritance: meaning that KeyList
is a subclass of Vector<Object>
. 它与继承有关:意味着
KeyList
是Vector<Object>
的子类。 Essentially it means that KeyList
is a modified Vector<Object>
in itself. 本质上,这意味着
KeyList
本身就是一个修改的Vector<Object>
。 For more information, you should read Oracle's docs on inheritance. 有关更多信息,您应该阅读Oracle的继承文档 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.