We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello,
I'm rather new to coding, and I'm having a few problems with some of my code. I have an array called array1 that has many empty parts. So I used the sort() method to put those first in the array so that I could make a for loop that found the last index where array1[i] was empty. This is what I wrote:
for (int i = 0; i < array1.length; i++);
{
if (array1[i].equals(""))
{
lastBlank = i;
}
}
The program keeps telling me that it "cannot find anything named 'i,' though. Any ideas about what I'm doing wrong?
Answers
You should aim to post a running code! [-X
the
;
in line one... It is "closing" the block, soi
is out of scope when you try to read it. Just remove this entryhere like _vk said
Thank you all so much. Just a stupid typo!