Tag: project valhalla

可以为null赋值null或与值类型变量进行比较吗?

在Java中,始终存在原始类型和引用,但不存在值类型。 Project Valhalla的目标之一是探索和孵化特征候选者,如价值类型 。 我想知道是否可以将null赋给值类型变量,或者是否可以将值类型变量与null进行比较。 如果没有,我也想知道原因。

Valhalla项目的价值类型是什么?

我已经开始阅读关于Project Valhalla的内容,而且有些东西我真的不明白,而且它是Value Types 。 这就是我的理解: 1)对象是否无法将其作为参考进行比较? final ValueType a = new ValueType(); final ValueType b = a; System.out.println(a==b); returns false???? 在Google AutoValue 代码示例中 ,它说明了这一点 if(o == this){return true;}//equals method implementation what is this? I am comparing references here right? 2)根据维基百科, 高效的小“对象”没有inheritance 。 Small Objects? Without inheritance意味着什么? 这是不可能使用VT? public final class ValueType extends Any //is this […]