Scanner reading large file
I am playing around with the Scanner class for learning purposes and i use it to read a very large file (60.000 lines aprox) without using the Reader class , and it stops reading after approximately 400 lines. Do i have to use a Bufferedreader inside the Scanner's constructor or the problem is something else? I want to know why this is happening. Thanks. My code is the usual code to output all the lines. File file1 = new File("file1"); Scanner in= new Scanner(file1); while (scan.hasNextLine() ) { String str = scan.nextLine(); System.out.println(str); } Ankit Rustagi This issue is usually more