SyntaxFix
Write A Post
Hire A Developer
Questions
Or use new try with resources clause combined with Scanner:
try (Scanner scanner = new Scanner(value)) { while (scanner.hasNextLine()) { String line = scanner.nextLine(); // process the line } }