String[] array;
int i = 0;
for(Element link : listOfLinks) {
array[i++] = link.text();
}
This is the code i'm trying to fill my array.
The error is that in the line:
array[i++] = link.text();
the word 'array' is highlighted and there is written: "The local variable array may not have been initialized"
i,arrayneeds to be initialized too. Remember, all variables have to be initialized before being used.String[] array = new String[100];for exampleString[] array = new String[listOfLinks.size()];