0

simple question for new babe

1: double[ ][ ] map; is it a valid array declaration above? 2: int[ ][ ] f = { {2,3,4}, {7}, {1,4} }; System.out.println( f[1][2] ); is it a runtime error or syntax error?

18th Oct 2018, 4:17 PM
Kynian
Kynian - avatar
1 Odpowiedź
+ 1
Assumed you mean in Java... 1: Yes, it is valid, but can't be used until it is initialized. 2: It is a runtime exception as you could have replaced f's value with a matrix that is valid.
18th Oct 2018, 9:47 PM
John Wells
John Wells - avatar