我遇到了一个术语“原始”对象。在搜索之后我发现原始类是没有直接父类(super class)的类,例如对象。这是正确的吗?
另外,我如何创建原始类,因为每个 Java 类都从 Object 类扩展而来。
最佳答案
你不能创建原始类。
Excepting Object, which has no superclass, every class has one and only one direct superclass (single inheritance). In the absence of any other explicit superclass, every class is implicitly a subclass of Object.
Classes can be derived from classes that are derived from classes that are derived from classes, and so on, and ultimately derived from the topmost class, Object. Such a class is said to be descended from all the classes in the inheritance chain stretching back to Object.
http://docs.oracle.com/javase/tutorial/java/IandI/subclasses.html
关于java - java中的原始类对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10765122/