Ok here is the syntax to open a file in java
import java.io.*;public static void main(String[] args){
String fname = "filename.txt";
try {
BufferedReader br = new BufferedReader(new FileReader(fname));String line = br.readline(); //Reads a single line from file. Return null if end of file is reached
br.read();//read single character from file.
br.close(); //closes the file} catch (IOException e) {
System.out.println(e);
}
}
}