package _02_数组练习;

public class Test {
    public static void main(String[] args) {
        /**
         * 需求:
         * int a = 10;
         * int b = 20;
         *
         * 交换a 和 b 的值
         */
//        int a = 10;
//        int b = 20;
//        a = b;   // a = 20  b=20
//        b = a;   // b = 20  a=20
//        System.out.println(a);
//        System.out.println(b);
        int a = 10;
        int b = 20;

        int temp = a;   // temp = 10
        a =  b;         // a = 20   b = 20
        b = temp;       // a = 20   b = 10
       System.out.println(a);
     System.out.println(b);
  }

}

