Boolean b = Boolean.parseBoolean("true"); Boolean c = Boolean.valueOf("true"); Float f = Float.valueOf("1011",2); Every wrapper has a public void toString(); method
How many compilable or true (in case of 4) statements do you see ?
answer:3 They have given description: The first 2 are true. Via autoboxing 1) goes into the variable. The valueOf returns a Boolean object anyhow. A little trick to remember the return type is: if you hear the primitive in it (pareInt, pareShort, intValue, shortValue...) then it returns a primitive, else an Object.
There is no parsexx & valueOf methods for Boolean in the K & B book. I am not getting why first two are true. Can anyone explain?