package andmevood; import java.io.BufferedReader; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; public class Fail5 { public static void main(String[] args) throws IOException{ BufferedReader sisse=new BufferedReader(new FileReader("isikud.txt")); PrintWriter valja=new PrintWriter(new FileWriter("vastus2.txt")); // sisse.lines().map(rida -> new Kodanik(rida)).sorted().forEach(valja::println); sisse.lines().map(Kodanik::new).sorted().forEach(valja::println); sisse.close(); valja.close(); } }