-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathArithmeticOperator.java
More file actions
45 lines (40 loc) · 939 Bytes
/
ArithmeticOperator.java
File metadata and controls
45 lines (40 loc) · 939 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package classes;
class ArithmeticOperator
{
public static void main(String[] args)
{
// 산술 연산자
System.out.println(2 + 3);
System.out.println(8 - 5);
System.out.println(7 * 2);
System.out.println(7 / 2);
System.out.println(8 % 5);
System.out.println();
// 증감 연산자 @case1
int value1 = 3;
value1++;
System.out.println(value1);
int value2 = 3;
++value2;
System.out.println(value2);
System.out.println();
// 증감 연산자 @case2
int value3 = 3;
int value4 = value3++;
System.out.println(value3);
System.out.println(value4);
System.out.println();
int value5 = 3;
int value6 = ++value5;
System.out.println(value5);
System.out.println(value6);
System.out.println();
// 증감 연산자 @case3
int value7 = 3;
int value8 = 4;
int value9 = 2 + value7-- + ++value8;
System.out.println(value7);
System.out.println(value8);
System.out.println(value9);
}
}