String a = “a" + "b" +1;String b = "ab1";System.out.println(a == b);结果:true由于编译器认为这三个常量叠加会得到固定的值,无需运行时再进行计算。