Zadanie z obsługi błędów
package pl.am.errors.lesson11;
import java.io.*;
import java.util.Scanner;
public class FileTest {
public static void main(String[] args) throws IOException {
FileWriter out = new FileWriter("out.txt", true);
out.write("testowa zawartośc pliku\n");
out.close();
Scanner scanner = new Scanner(new File("out.txt"));
while(scanner.hasNext()) {
System.out.println(scanner.nextLine());
}
scanner.close();
}
}