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
Post a Comment