Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
3 lines (2 loc) · 308 Bytes

File metadata and controls

3 lines (2 loc) · 308 Bytes
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
1. String s = "a" + "b"编译器会进行常量折叠(因为两个都是编译期常量编译期可知),即变成 String s = "ab"
2. 对于能够进行优化的(String s = "a" + 变量 ) StringBuilder append() 方法替代最后调用 toString() 方法 (底层就是一个 new String())
Morty Proxy This is a proxified and sanitized view of the page, visit original site.