【发布时间】:2014-07-17 07:17:33
【问题描述】:
PMD 警告我避免布尔实例化(出于效率原因)。 我有这样的东西
Boolean variable = new Boolean(somestringIGotRepresentingABoolean);
我应该使用这个
Boolean variable = Boolean.valueOf(somestringIGotRepresentingABoolean);
为什么这样更好?
【问题讨论】:
标签: java performance pmd