I came across this answer to a locked question. Now I didn't realise at first the question was locked and I wanted to edit it so as to show there's a different approach since Java 7.
It hurts my feelings that I cannot edit it or remove it in any way. I don't see why it is worthy to keep such questions / answers...
Any ideas how to edit / remove this?
(This would it be by the way)
try (Scanner scanner = new Scanner(Paths.get("filename"))) {
String str = scanner.nextLine();
} catch (IOException e) {
// handle it
}