forked from AndrewProgramming/JavaTutorialCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.java
More file actions
23 lines (21 loc) · 678 Bytes
/
Test.java
File metadata and controls
23 lines (21 loc) · 678 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package operator.math;
public class Test {
public static void main(String[] args) {
int a = 10;
int b = 20;
int c = 25;
int d = 25;
System.out.println("a + b = " + (a + b));
System.out.println("a - b = " + (a - b));
System.out.println("a * b = " + (a * b));
System.out.println("b / a = " + (b / a));
System.out.println("b % a = " + (b % a));
System.out.println("c % a = " + (c % a));
System.out.println("++a = " + (++a));
System.out.println("a-- = " + (a--));
System.out.println("a="+a);
// 查看 d++ 与 ++d 的不同
System.out.println("d++ = " + (d++));
System.out.println("++d = " + (++d));
}
}