If the object is actually an instance of Boolean , then simply enter it:
boolean di = (Boolean) someObject;
An explicit conversion will do the conversion to Boolean , and then be automatically-unboxing to a primitive value. Or you can do it explicitly:
boolean di = ((Boolean) someObject).booleanValue();
If someObject does not refer to a Boolean value, what do you want the code to do?
Jon Skeet Feb 05 '10 at 10:48 2010-02-05 10:48
source share