This is basically the exact same as Jesus Ramos' answer, except with File instead of FileReader plus iteration to step through the contents of the file.
Scanner in = new Scanner(new File("filename.txt"));
while (in.hasNext()) { // iteratesIterates each line in the file
String line = in.nextLine();
// doDo something with line
}
in.close(); // don'tDon't forget to close resource leaks
... throws FileNotFoundException