How to read a file in Java
import java.io.*;
public class InputExample {
public static void main(String args[]) {
try {
// This creates an object from which you can read input lines.
BufferedReader reader =
new BufferedReader(new FileReader("Mitochondrion.txt"));
String line = null;
// readLine reads input lines (without the \n), catching any
// exceptions, and returns null if there is no more input.
while ((line = reader.readLine()) != null)
System.out.println("Got: ==" + line + "==");
}
catch (IOException e) {
System.out.println("Caught IO exception");
}
}
}