Why not add some extra lines and do some investigating yourself? System.out.println(obj.getClass())
– Alan KavanaghJun 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
– Youcef LAIDANIJun 18 '16 at 17:54