字符串
public class Application {
public static void main(String[] args) {
String str1="a"+1+2;//a12 字符串在前,后面均视为字符串
int str2='a'+1+2;//100 单个字符会转换为具体的值:a=97,再计算
String str3=1+2+"a";//3a 字符串在后,将前面的运算结果再与其拼接
System.out.println(str1);
System.out.println(str2);
System.out.println(str3);
}
}
浙公网安备 33010602011771号