summaryrefslogtreecommitdiffstats
path: root/src/test/test4/NewRemover.java
blob: ff57ce2dcb7e4b4db47a21ddf9f7c05c04543fe1 (plain)
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
29
30
package test4;

public class NewRemover {
    static NewRemover obj = new NewRemover(7);
    int value;
    static int value2 = 5;

    public NewRemover() {
        this(3);
    }

    public NewRemover(int k) {
        value = k;
    }

    public int run() {
        return make();
    }

    public int make() {
        NewRemover nr = new NewRemover(value2 > 0 ? 3 : 0);
        return nr.value;
    }

    public static NewRemover make2(int z) {
        System.out.println("make2 " + z);
        obj.value += z;
        return obj;
    }
}