Returns a Boolean with a value represented by the specified string. The Boolean returned represents a true value if the string argument is not null and is equal, ignoring case, to the string "true".
所以,Boolean.valueOf("1")
returns false.
有點荒謬又不會太荒謬,能理解又不太能理解,以後看到 Boolean.valueOf() 要特別小心。
沒有留言:
張貼留言