Hi all, i am getting a coupke of compile errors with this code, any ideas - stuck on it for a good few hours now.
im getting a identifier in line 23 expected
}
and
illiegal start of type
try
^
Any help is appreciated.
[code=java]
import java.io.*;
import java.awt.*;
import java.util.*;
public class FileWriter2
{
String pathName = "C:\\BlueJ\\bre n.txt";
File aFile = new File(pathName);
try
{
FileWriter aFileWriter = new FileWriter(aFil e);
aFileWriter.wri te("Test");
aFileWriter.clo se();
}
catch (Exception anException)
{
System.out.prin tln("error :" + anException)
}
}
[/code]
im getting a identifier in line 23 expected
}
and
illiegal start of type
try
^
Any help is appreciated.
[code=java]
import java.io.*;
import java.awt.*;
import java.util.*;
public class FileWriter2
{
String pathName = "C:\\BlueJ\\bre n.txt";
File aFile = new File(pathName);
try
{
FileWriter aFileWriter = new FileWriter(aFil e);
aFileWriter.wri te("Test");
aFileWriter.clo se();
}
catch (Exception anException)
{
System.out.prin tln("error :" + anException)
}
}
[/code]
Comment