Immutable
final 的题
String a = "lee1";
final String b = "lee";
String c = "lee";
String str1 = b + 1;
String str2 = c + 1;
// question
// 1. a == str1 ?
// 2. a == str2 ?
- 键入
123
看解释
String a = "lee1";
final String b = getString();
String str1 = b + 1;
private String getString() {
return "lee";
}
// question
// a == str1 ?