问一个java语言规范纯理论问题
A variable of an interface type can hold a null reference or a reference to any
instance of any class that implements the interface.
Note that a variable is not guaranteed to always refer to a subtype of its declared type, but
only to subclasses or subinterfaces of the declared type. This is due to the possibility of
heap pollution discussed below.
------The Java™ Language Specification Java SE 7 Edition 第4章 4.12.2
请问上面讲到的subtype 跟subclass,subinterface分别指的是什么?
instance of any class that implements the interface.
Note that a variable is not guaranteed to always refer to a subtype of its declared type, but
only to subclasses or subinterfaces of the declared type. This is due to the possibility of
heap pollution discussed below.
------The Java™ Language Specification Java SE 7 Edition 第4章 4.12.2
请问上面讲到的subtype 跟subclass,subinterface分别指的是什么?
...全文
相关推荐
华为Java语言编程规范
华为Java语言编程规范是一份由华为公司OMC与网管研究管理部和智能业务研究管理部提出的编程指南,旨在为Java开发者提供明确的指导,确保代码质量和一致性。该规范是在参考《软件编程规范总则》和SUN公
Java语言规范和JVM规范(7、8、9)
Java语言规范和JVM规范是理解Java编程语言和其运行机制的基石,它们定义了Java程序的语法、语义以及虚拟机如何执行这些程序。
Java语言安全编程规范
Java语言安全编程规范是开发高质量、健壮且安全的软件应用程序的基础。在Java中,安全性不仅涉及代码的正确性,还包括防止恶意攻击、数据保护以及遵循最佳实践来降低潜在的安全风险。
Java语言规范和JVM规范官网文档
本压缩包包含了Java6至Java9的版本,涵盖了一系列重要的语言和虚拟机改进,对于Java开发者来说,深入研究这些规范能够提升编程技能,解决实际问题。首先,让我们关注Java语言规范。
每个Java程序员必读:Java语言规范解析
在Java中,类是一种复合数据类型,它将数据和操作数据的方法封装在一起。类的定义包含类的声明、类体和构造方法。在上述示例中,MyClass是一个拥有两个私有成员变量和一个构造方法的类。类的实例化通常需要使用new关键字,如下所示:通过实例化过程,我们创建了MyClass类的一个对象myObject,并调用了构造方法来初始化对象的属性。接口(Interface)是Java中的一种引用类型,它包含了一系列方法的声明,但是不包含方法的具体实现。类通过关键字。


Java SE
