I found a bit of coding here: Java: Printing from a file
Scanner fRead = new Scanner(new File(targetFileName));
while (fRead.hasNextLine())
System.out.println(fRead.nextLine());
My questions:
- Does creating a File object from 'file.txt' open said file?
- If so (I'm relatively certain it would), wouldn't the snippet leave said file open?
- What happens when said file is left open after the program terminates?