首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Joiner线程安全吗?

Joiner线程安全吗?
EN

Stack Overflow用户
提问于 2010-03-04 04:46:59
回答 2查看 2K关注 0票数 16

google collections线程安全吗?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2010-03-04 04:53:13

它的唯一状态是

代码语言:javascript
复制
  private final String separator;

所以,是的,它是线程安全的。

票数 16
EN

Stack Overflow用户

发布于 2010-03-04 07:48:40

是!我们不会重复SimpleDateFormat的错误。:-)

Joiner需要获得与其姊妹类Splitter类似的文档升级,即:

代码语言:javascript
复制
* <p><b>Warning: splitter instances are always immutable</b>; a configuration
* method such as {@code omitEmptyStrings} has no effect on the instance it
* is invoked on! You must store and use the new splitter instance returned by
* the method. This makes splitters thread-safe, and safe to store as {@code
* static final} constants . . .
票数 29
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2374823

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档