java - Unquantifying an integer -


is possible create int variable no value, quantify in code, , "unquantify" no longer has value?

example:

class test {      int integer;      public static void main (string[] args) {          integer = 1;         ...         //do stuff         ...         integer = null; //does line set integer's value nothing?                         // want able reset value of integer when defined (the value nothing, had no value)      } } 

edit: grammar

you cannot assign null primitive type.

you use integer object this:

integer = null; 

if have int classmember , access inside method value of int 0.

also have make variable static access in main.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -