How to make int variable null?
Hey. I saw a question on this site and thought I would do it myself. The question was something of the lines of finding a value in an array 1-100( a value is missing and you should find it). This is what I did; int [] Numbers= new int [100]; Numbers[2]=4; \\ I want to change this address to null int [] NumbersComparison=new int[100]; for(int Counter=1;Counter<Numbers.length;Counter++){ if(Numbers[Counter] !=NumbersComparison[Counter]){ System.out.println(Numbers[Counter]); } } I made 2 arrays. One array has all the values from 1-100 and the other has one value that is different than what it should be. I then used a loop to go through the array with one value changed and said:if that value does not equal the value in the same address in the other array,display the value that is incorrect. Anyway, to my question ,how do I set a value to nul/nothing ? I tried using the keyword "null" but that does not work.