Multiple Choice Question

Quiz Guidelines

 

QID: 
409
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

Q&A Set: 

Search the Web

Custom Search

Searches whole web. Use the search in the right sidebar to search only within javajee.com!!!