1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import java.io.*;

public class Overwrite {
    public static final void main(String[] args) {
        BufferedWriter writer = null;
        try {

        writer = new BufferedWriter(new FileWriter("koce_podatki.txt", true));
            //WRITES 1 LINE TO FILE AND CHANGES LINE
            writer.write(args[0]);
            writer.newLine();
            writer.close();
        } catch (Exception e) {

        }

        try {

        writer = new BufferedWriter(new FileWriter("s_koce.txt", true));
            //WRITES 1 LINE TO FILE AND CHANGES LINE
            writer.write(args[1]);
            writer.newLine();
            writer.close();
        } catch (Exception e) {

        }
    }
}