Creating Nullables types in java
问题 I am trying to create a nullalble object in Java but no idea how to do this , in C# this would be done like this int? someTestInt; This allows me to check for for null , while in certain cases i can use a 0 value ,this isnt always possible since certain execution paths allow 0 values 回答1: I'm not entirely sure what you want, but if you want to have an integer value that also can be declared null , you probably want to use the Integer class: Integer nullableInteger = 1; nullableInteger = null;