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

String 和StringBuilder、StringBuffer 的区别? #48

Copy link
Copy link
@strongant

Description

@strongant
Issue body actions

String是只读、不可变类,StringBuffer/StringBuilder可以修改指定的字符串对象。StringBuilder是JDK5引入的,StringBuilder中对字符串的操作不是同步的,在单线程环境下使用,实现和StringBuffer一样,效率比StringBuffer高。当在静态存储区中已经有定义好的字符串时,此时使用“+”的方式反而比使用StringBuilder和StringBuffer性能高。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.