When I run this code the conversion of a string to int is printing out NULL ? When I print out the string it gives me a string number, but when I try to convert that string into a int it says null, why is that?
for(int j = 0; j < removetrack.size(); j++){
String removetrackArray[] = removetrack.get(j).split(" ");
String candidateBefore = "";
int removetracklocation = Arrays.asList(removetrackArray).indexOf(past)-1;
if(removetracklocation != 1) {
String candidateBefore = "";
System.out.println(removetrack.get(j)+" location = "+ removetracklocation +" "+
(past)+" candidate name "+dictionary.get(votedfor) );
candidateBefore= Arrays.asList(removetrackArray).get(removetracklocation+1);
System.out.println(" this is a string "+candidateBefore);
System.out.println( Integer.getInteger(candidateBefore));
}
}