java - java中的原始类对象

标签 java

我遇到了一个术语“原始”对象。在搜索之后我发现原始类是没有直接父类(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/

相关文章:

java - Arrays.sort 使用 Lambda 然后比较

java - 是否有任何负责 OAuth 的黑莓 Twitter SDK[Java]

java - 为什么在这种情况下不会发生死锁

java - 如何在 Java 中使用 XPath 读取 XML

java - Netbeans MVC Swing JTable ResultSet 数据插入

java - 我需要知道我的应用程序可以安装在外部存储器上的内容

java - 无法在 Windows 10 上运行作为服务运行的 Java 应用程序的 Continuous Flight Recorder

java - Greenfoot 编程 - Actor 行为

java - 如何为 JUnit 测试声明 "mixins"?

java - 如何将多个动画 GIF 组合成一个 GIF 网格