算术运算符 / 的使用
class TestAri{
public static void main(String[] args){
int i = 12;
int j = i / 5;
double d = (double) i / 5;
double d1 = i / 5.0;
System.out.println( j ); //2
System.out.println( d ); //2.0
Systerm.out.println( d1 ); //2.4
}
]
算术运算符 / 的使用
class TestAri{
public static void main(String[] args){
int i = 12;
int j = i / 5;
double d = (double) i / 5;
double d1 = i / 5.0;
System.out.println( j ); //2
System.out.println( d ); //2.0
Systerm.out.println( d1 ); //2.4
}
]