Home:ALL Converter>Can null be assigned to or be compared to a value type variable?

Can null be assigned to or be compared to a value type variable?

Ask Time:2018-02-09T05:14:01         Author:fps

Json Formatter

In Java, there have always existed primitive types and references, but not value types.

One of the goals of Project Valhalla is to explore and incubate feature candidates such as value types.

I would like to know if null can be assigned to a value type variable, or if a value type variable can be compared to null.

If not, I would also like to know why.

Author:fps,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/48694891/can-null-be-assigned-to-or-be-compared-to-a-value-type-variable
John :

From here: https://wiki.openjdk.java.net/display/valhalla/Minimal+Value+Types\n\nValue types are \"immutable, identity-agnostic, non-nullable, non-synchronizable, final\"\n\nSo no, it can't be null ",
2018-02-08T21:18:47
yy