请教各位,int avg2="78.5"+rise 为啥不行呢?
public class HelloWorld{
public static void main(String[] args) {
double avg1=78.5;
int rise=5;
int avg2="78.5"+rise;
System.out.println("考试平均分:"+avg1);
System.out.println("调整后的平均分:"+avg2);
}
}
public class HelloWorld{
public static void main(String[] args) {
double avg1=78.5;
int rise=5;
int avg2="78.5"+rise;
System.out.println("考试平均分:"+avg1);
System.out.println("调整后的平均分:"+avg2);
}
}
2022-04-18
举报