int a=22; String str="11"+a;//编译期就在常量池相加,因为a不是字符串 String str2="11"+22;//编译期就在常量池相加 System.out.println(str);