I don't think their use of "object type" and "reference type" is standardized, but here's my interpretation.
Consider this code:
Object o = new Integer(3);
The reference o
is of type Object
. The object that it references is of type Integer
.
So the "reference type" would be Object
and the "object type" would be Integer
.
What makes this confusing is that there's the (standardized, official) term "reference type" that encapsulates types that can be referenced. In Java that includes all classes, enums, interfaces, arrays. It excludes only the primitive types (int
, ...).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…