1 public class Demo6 {
2 public static void main(String[] args) {
3 //二元运算符
4 //ctrl + D :复制当前行到下一行
5 int a = 10;
6 int b = 20;
7 int c = 25;
8 int d = 25;
9
10 System.out.println(a+b);
11 System.out.println(a-b);
12 System.out.println(a*b);
13 System.out.println(a/(double)b);
14 }
15 }
1 public class Demo7 {
2 public static void main(String[] args) {
3 long a = 212343453431L;
4 int b = 10;
5 short c = 10;
6 byte d = 8;
7 int e = 21;
8
9 System.out.println(e%b);//e/b 21/10 = 2...1
10
11 System.out.println(a+b+c+d);//Long
12 System.out.println(b+c+d);//Int
13 System.out.println(c+d);// Int
14
15 }
16 }