증감연산자 - GeunYoungg/android GitHub Wiki

증감연산자

전위 후위 증감연산자 예제

참고

코드

int a = 2;
int b = 3;
System.out.println("1. Post-Increment Operator : " + a + b++);
System.out.println("2. Pre-Increment Operator : " + a + ++b);
System.out.println("3. Post-Increment Operator : " + (a + b++));
System.out.println("4. Pre-Increment Operator : " + (a + ++b));

결과

1. Post-Increment Operator : 23
2. Pre-Increment Operator : 25
3. Post-Increment Operator : 7
4. Pre-Increment Operator : 9
⚠️ **GitHub.com Fallback** ⚠️