0

For example I made an integer i:

int i = 100;

Now I want to assign a value, as if I did:

int i;

What do I need to write in order to make my integer null (0 is not null)? null does not work for some reason.

John Kugelman
  • 349,597
  • 67
  • 533
  • 578
Brandon Nova
  • 31
  • 2
  • 8
  • 1
    You can't uninitialise a variable. You can set it to null, but it needs to be a reference type (such as `Integer`) instead of a primitive type (such as `int`). – khelwood Mar 18 '22 at 14:44
  • Thanks so much for the quick response. I'm going to try initializing as an Integer type instead. – Brandon Nova Mar 18 '22 at 14:48

0 Answers0