| 4 | import java.util.List; |
| 5 | |
| 6 | class FileIoDemo { |
| 7 | public static void main(String[] args) throws IOException { |
| 8 | Path path = Path.of("scores.txt"); |
| 9 | |
| 10 | List<String> lines = List.of("Ava,82", "Leo,77", "Mia,91"); |
| 11 | Files.write(path, lines); |
| 12 | |
| 13 | List<String> readBack = Files.readAllLines(path); |
| 14 | for (String line : readBack) { |
| 15 | System.out.println(line); |
| 16 | } |
| 17 | |
| 18 | Files.deleteIfExists(path); |
| 19 | } |
| 20 | } |
nothing calls this directly
no outgoing calls
no test coverage detected