Re: Changing the value of Boolean?
From: Dale King (kingd[at]tmicha[dot]net)
Date: Fri, 20 Feb 2004 22:05:32 -0500
"xarax" <email@example.com> wrote in message
> > But in the case of boolean, instead of creating a new Boolean using
> > something like "new Boolean(false)", use the Boolean b = Boolean.FALSE
> > instead.
> Exactly right. A simple idiom is:
> /* Translate boolean primitive to Boolean instance. */
> theBoolean = (bool ? Boolean.TRUE : Boolean.FALSE);
And starting with JDK1.4 you no longer have to do that. There is now a
Boolean.valueOf( boolean ) method that does exactly the same thing.
-- Dale King