I have a strange problem with Strings and I cannot understand why. I suspect variable scope but since I am not sure, I am posting here for help.
I have a class method that must return a double dimensional String array. The variable I want to return is named "dataToReturn".
The method works fine according to its task. I have put various "println" during method execution and I am positive that the "dataToReturn" is populated correctly.
But at the end of the method, when I am returning the array, all array elements are null, so my program crashes with NullExceptionPointer because I need to work on the returned array.
Can you please help me?
Is it something with scoping issues?
I am reading some XML values in the first big for loop and I am assingning values to the array elements (I am checking that they are correctly assigned with "println" statements). Maybe when I come out of the for loop, these array elements which are String objects, are not present any more??