Array values return null constantly

I’m afraid that you are confused.

If arrayA is declared to have type double[][] then it is impossible for arrayA[2][2] to be null.

The type of arrayA[2][2] is double, and null is not a member of that type. Not ever. The null value is only valid for reference types, and double is a primitive type, not a reference type.

Either the program is not as you are describing it, or something else is causing a different value to be placed into the text box.


(Now if arrayA was declared to be a Double[][], it would be a different matter.)

Leave a Comment