posted 18 years ago
Actually, stripping all the file reading code leaves this (formatting cleaned up):
The problem is that "list" is declared inside the try block, so that it's only visible inside that try block; but the code tries to use it at the last line, which is outside the try, so "list" is undefined.
Just move the line that declares the ArrayList:
Now "list" is visible to all the code in the whole function.