This is the snippet of Java code.
class Test{
public static void main(String[ ] args){
int[] a = { 1, 2, 3, 4 };
int[] b = { 2, 3, 1, 0 };
System.out.println( a [ (a = b)[3] ] );
}
}
Why does it print 1? This is not a homework! I am trying to understand Java. That is related to OCA Java 7 exam.
adoesn't see the inner assignment toa.