originally posted by Ashish Hareet
Form the java docs(note: referring 1.5, do check with others) for the 'b' it states 'If the argument arg is null, then the result is "false". If arg is a boolean or Boolean, then the result is the string returned by String.valueOf(). Otherwise, the result is "true".'
You can read more about this here - http://java.sun.com/j2se/1.5.0/docs/api/java/util/Formatter.html#syntax
scroll a little down to "Conversions"
Hi Ashish,
from the link you sent me I found this quote from the page,
'b', 'B' general If the argument arg is null, then the result is "false". If arg is a boolean or Boolean, then the result is the string returned by String.valueOf(). Otherwise, the result is "true".
but if you compare this description with that from the API docs for Boolean(String) you find
public Boolean(String s)
Allocates a Boolean object representing the value true if the string argument is not null and is equal, ignoring case, to the string "true". Otherwise, allocate a Boolean object representing the value false.
I think that these two modes of operation are contradictory.
Regards
Robert.
[ June 21, 2008: Message edited by: robert stannard ]