为什么Boolean.getBoolean("true")会等于false?

arlaichin 2004-08-05 03:02:31
谢谢!
...全文
200 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
ukulele8656 2004-08-05
  • 打赏
  • 举报
回复
Returns true if and only if the system property named by the argument exists and is equal to the string "true". (Beginning with version 1.0.2 of the JavaTM platform, the test of this string is case insensitive.) A system property is accessible through getProperty, a method defined by the System class.
If there is no property with the specified name, or if the specified name is empty or null, then false is returned.


ntzls 2004-08-05
  • 打赏
  • 举报
回复
要构造Boolean 用new Boolean("true");

Boolean.getBoolean()方法的参数是system property。

62,623

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧