float跟double
public static void main(String[] args) {
int age1=24;
int age1=24;
float avg1=(age1+age2)/2f;
double avg2=(age1+age2)/2;
System.out.println(avg1);
System.out.println(avg2);
}
public static void main(String[] args) {
int age1=24;
int age1=24;
float avg1=(age1+age2)/2f;
double avg2=(age1+age2)/2;
System.out.println(avg1);
System.out.println(avg2);
}
2016-01-21
举报