String 能更新么
public class HelloWorld {
public static void main(String[] args) {
int age=25;
if (age>60) {
String note = "老年";
System.out.println(note);
}
else if ((age>40)&&(age<60)){
note = "中年";
System.out.println(note);
}
else if ((age>18)&&(age<40)){
note = "少年";
System.out.println(note);
}
else{
note = "童年";
System.out.println(note);
}
}
}
int 的时候这样写可以, string就不能更新?