a=2,b=++a,
b=3,a=3.(先运算,后取值)
a=2,b=a++,
b=2,a=3.(先取值,后运算)
a=2,b=–a,
b=1,a=1.(先运算,后取值)
a=2,b=a–,
b=2,a=1.(先取值,后运算)
int num1= 12;
int num2= 5;
int result1=num1/num2;
System.out.println(result1);//2
double result2=num1/(num2+0.0);
System.out.println(result2);//2.4
double result3=(double)num1/num2;
System.out.println(result3);//2.4
double result4=(double)(num1/num2);
System.out.println(result4);//2.0
int i1= 12;
int i2= 5;
System.out.println(i1%i2);//2
int i1= -12;
int i2= 5;
System.out.println(i1%i2);//-2
int i1= 12;
int i2= -5;
System.out.println(i1%i2);//2
int i1= -12;
int i2= -5;
System.out.println(i1%i2);//-2