public class SideEffects {
    int y;
    public static void main(String[] args) {
        new SideEffects();
    };
    public SideEffects(){
        y=5;
        System.out.println(f(1)+g(2));
        y=5;
        System.out.println(g(2)+f(1));
    }
    public int g(int z){
        return z+y;
    }
    public int f(int x){
        y++;
        return x;
    }

}