The code below produces the following error when I try to compile it:
cannot find symbol
symbol : variable airplanesFile
The error is produced by the last statement.
Why can the RandomAccessFile object not be found after it's declared?
Thanks!
public static void main(String[] args)
{
try
{
RandomAccessFile airplanesFile = new RandomAccessFile("airplanesFile.ran", "rw");
}
catch (FileNotFoundException fnfe)
{
fnfe.printStackTrace();
}
airplanesFile.writeUTF("Test");
}