I have the code:
for (int i = 0; i < directory.length; i++) {
if (directory[i].contains (number)) {
if (directory[i+1] == null){
directory[i] = null;
}
else {
for (int k=i; k<directory.length; k++){
System.out.println(directory[k]);
System.out.println(directory[k+1]);
if (directory[i+1] != null){
directory[k] = directory[k+1];
System.out.println(directory[k]);
}
The important bit i think is "if (directory[i+1] != null){" what i am using is an array and i am trying to find if the next element is not null then do the code. However, even if the next value is null it does it anyway. Any suggestions?
Thank you.
i-versus-ktypo issue.iloop, no?