...
Thanks for your answer but I have tried that
and keep get the message "cannot resolve symbol
- variable InitialisationValues. The code is
below and I am wondering if anyone can tell me
where im going wrong.
The error message tells the answer. At the point when you try to return
"initialisationValues" it doesn't exist, since it simply has gone "out of
scope".
I have snipped your example a bit to show what's happening:
public String[][] getContents()
{
[snip]
try
{
// And here you define "initialisationValues"
// *inside* the try-block...
String[][] initialisationValues =
new String[arraySize][7];
[snip]
// And here you *leave* the try-block...
}
catch (FileNotFoundException ex)
{
ex.printStackTrace();
}
catch (IOException ex)
{
ex.printStackTrace();
}
finally
{ [snip]
}
// And hence "initialisationValues" have "disappeared"...
return initialisationValues;
}
You could declare initialisationValues in the beginning of getContents, like
this:
String[][] initialisationValues = null;
I haven't checked your code for any logical errors, but with this change it
at least goes through compilation.
// Bjorn A