1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*
 * 증감연산자 : 1씩 증가하거나 감소하는 연산자
 *  - 종류 : 연산우선순위에 의해 => 전위 연산자와 후위 연산자
 *              : ++ / --
 * */
public class Exam_04 {
    public static void main(String[] ar){
        int x = 10, y = 0;
        
        y = x++;
        
        System.out.println("x = " + x); //  11
        System.out.println("y = " + y); //  10
    }
}
 
cs


+ Recent posts