0

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. This is part of an implementation of Eliza that I found online


extends means that KeyList is-a Vector. It does not (necessarily) mean that KeyList has-a Vector.

See The Java Tutorial for more, specifically What Is Inheritance? and the Inheritance section.

4

2 回答 2

4

extends表示KeyList is-a Vector。它并不(必然)意味着KeyList has-a Vector

有关更多信息,请参阅 Java 教程,特别是什么是继承?继承部分

于 2013-10-28T17:54:36.080 回答
0

It is about inheritance: meaning that KeyList is a subclass of Vector<Object>. Essentially it means that KeyList is a modified Vector<Object> in itself. For more information, you should read Oracle's docs on inheritance.

于 2013-10-28T17:55:53.437 回答