1、最后输出的是啥?
String s = "hello";
final String str = s;
s = "world";
System.out.println("str = " + str);
答案:hello,扩展,无论是否加final,都是hello
1、最后输出的是啥?
String s = "hello";
final String str = s;
s = "world";
System.out.println("str = " + str);
答案:hello,扩展,无论是否加final,都是hello
转载于:https://my.oschina.net/HiAscend/blog/1163001