来银啦,求解答?
public class HelloWorld{
public static void main(String[] args) {
double avg1=78.5;
int rise=5;
double avg2=avg1+rise;
System.out.println("考试平均分:"+avg1);
System.out.println("调整后的平均分:"+avg2);
}
}
有木有能告诉我为什么是double avg1=78.5;而不int avg1=78.5
public class HelloWorld{
public static void main(String[] args) {
double avg1=78.5;
int rise=5;
double avg2=avg1+rise;
System.out.println("考试平均分:"+avg1);
System.out.println("调整后的平均分:"+avg2);
}
}
有木有能告诉我为什么是double avg1=78.5;而不int avg1=78.5
2017-07-22
举报