Skip to content

Commit 1cf762b

Browse files
UPOPsgitee-org
authored andcommitted
update docs/java/basis/java-basic-questions-02.md.
被 `final` 关键字修改之后的 `String` 会被编译器当做常量来处理,其中的“修改用词不太准确”
1 parent 147fd4f commit 1cf762b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/java/basis/java-basic-questions-02.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ String d = str1 + str2; // 常量池中的对象
665665
System.out.println(c == d);// true
666666
```
667667
668-
被 `final` 关键字修改之后的 `String` 会被编译器当做常量来处理,编译器在程序编译期就可以确定它的值,其效果就相当于访问常量。
668+
被 `final` 关键字修饰之后的 `String` 会被编译器当做常量来处理,编译器在程序编译期就可以确定它的值,其效果就相当于访问常量。
669669
670670
如果 ,编译器在运行时才能知道其确切值的话,就无法对其优化。
671671

0 commit comments

Comments
 (0)