public class SideEffectsFinal {
    final int y;
    public static void main(String[] args) {
        new SideEffectsFinal();
    };
    public SideEffectsFinal(){
        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;
    }


}