java - How to access array boolean value -- array required, but Object found -
I'm having trouble reaching an array Boolean value such as the following ...
< Code> boolean [] [] sub = new boolean [] []; Object [] record = new object []; Record [0] = all; If (record [0] [0] [1] == false) {// do something} When I set a clock, then I get the type of bullion and the false value The I compiler gives an error of the required array, but the object is found.
The record is [] array type object, but inside each code it contains the boolean [] [] array I have tried casting but it is not working Is (i.e. (boolean) record [0] [0] [1] ). Does anyone think about using boolean values?
If has every element of the record boolean Casting should be done on the first access to the that array: if ((((boolean [] []] [[record [0])) [0] [1] == incorrect) {// do something} Or better yet, false , evaluate array contents: if (! ((Boolean [] []) (record [0])) [0] [1]) {// do something}
Comments
Post a Comment