you can cast it like that Object obj = new Object(); boolean b = (boolean) obj;
– YCF_LJun 18 '16 at 17:48
Why not add some extra lines and do some investigating yourself? System.out.println(obj.getClass())
– AK47Jun 18 '16 at 17:50
Exception in thread "main" java.lang.ClassCastException: java.lang.Object cannot be cast to java.lang.Boolean so this is wrong right @Alan
– YCF_LJun 18 '16 at 17:54