1.习题1
输出下列代码结果并说明原因
案例1:
public static void main(String[] args) {
String a = "a1";
String b = "a" + 1;
System.out.println(a == b);
true
}
案例2:
public static void main(String[] args) {
String a = "ab";
String bb = "b";
String b = "a" + bb;
System.out.println(a == b);
false
}
案例3:(选做题)
public static void main(String[] args) {
String a = "ab";
final String bb = "b";
String b = "a" + bb;
System.out.println(a == b);
true
}