Multiple Choice Question

Quiz Guidelines

 

QID: 
22
Tags: 
Question: 

Consider the following class...

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] ] );

}

}

What will it print when compiled and run ?

Select 1 option

A. It will not compile.

B. It will throw ArrayIndexOutOfBoundsException when run.

C. It will print 1.

D. It will print 3.

E. It will print 4

F. It will print 2

Q&A Set: