字符串

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);
}
}
posted @ 2023-02-10 16:07  惊鸿宴远赴人间  阅读(10)  评论(0)    收藏  举报