package com.lovecoding.day11.ex01;

public class Test3 {
    static int x, y, z;// 0 成员变量

    static {
        int x = 5; //局部变量
        x--; //局部
    }

    //x, y, z = 0
    static {
        x--;
    }
    //x = -1 , y, z = 0
    public static void method() {
        //x = -1 , y,  = 0  z = -1
        //  -1  + 1
        y = z++ + ++z;
        // y = 0
    }

    public static void main(String[] args) {
        System.out.println("x=" + x); // -1
        z--;
        //x = -1 , y,  = 0  z = -1
        method();
        //x = -1 , y, z = 1
        System.out.println("result:" + (z + y + ++z)); // 3

        //x = -1 y = 0 z = 1  result 3
    }
}
