try(FileReader fileReader = new FileReader("src/myfile.txt");
BufferedReader reader = new BufferedReader(fileReader)){
String line = null;
while ((line = reader.readLine()) != null) {
System.out.println(line);
}
}
Assumptions:
1. myfile.txt is available in eclipse's src directory.
BufferedReader reader = new BufferedReader(fileReader)){
String line = null;
while ((line = reader.readLine()) != null) {
System.out.println(line);
}
}
Assumptions:
1. myfile.txt is available in eclipse's src directory.