A question taken from Java exam
Posted
by chun
on Stack Overflow
See other posts from Stack Overflow
or by chun
Published on 2010-04-26T13:40:52Z
Indexed on
2010/04/26
13:43 UTC
Read the original article
Hit count: 234
java
public static void main(String[] args)
{
int [][]shatner = new int[1][1];
int []rat = new int[4];
shatner[0] = rat;
System.out.println(shatner[0][3]);
}
surprised, The answer is 0, Java doesn't check this kind of indexOutOfBound error?
© Stack Overflow or respective owner