细木工线程安全吗?

2022-09-03 03:49:27

谷歌收藏细木工线程安全吗?


答案 1

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

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

* <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 . . .

答案 2

它的唯一状态是

  private final String separator;

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


推荐