728x90
package ch01_variable_operator;
public class PlusMinus01 {
public static void main(String[] args) {
int a = 10, b = 20, c ;
c = ++a + b++ ;
System.out.println("a : "+ a); //11
System.out.println("b : "+ b); //21
System.out.println("c : "+ c); //31
c = a++ + --b ;
System.out.println("a : "+ a);
System.out.println("b : "+ b);
System.out.println("c : "+ c);
a = 15 ;
b = 12 ;
c = --a + --b ;
System.out.println("a : "+ a);
System.out.println("b : "+ b);
System.out.println("c : "+ c);
}
}
728x90
반응형
'console.log("What ? " + Cord); > Java' 카테고리의 다른 글
<Git>PrintMe.java (0) | 2023.02.05 |
---|---|
<Git>PlusMinus02.java (0) | 2023.02.05 |
<Git>OperatorEx.java (0) | 2023.02.04 |
<Git>Operator01.java (0) | 2023.02.04 |
<Git> Increment01.java (0) | 2023.02.04 |