Multiple Choice Question

Quiz Guidelines

 

QID: 
410
Tags: 
Question: 

What will be the result of trying to compile and execute of the following program?

public class TestClass{
public static void main(String args[] ){
int i = 0 ;
int[] iA = {10, 20} ;
iA[i] = i = 30 ;
System.out.println(""+ iA[ 0 ] + " " + iA[ 1 ] + " "+i) ;
}
}

Select 1 option

A. It will throw ArrayIndexOutofBoundsException at Runtime.
B. Compile time Error.
C. It will prints 10 20 30
D. It will prints 30 20 30
E. It will prints 0 20 30

Q&A Set: 

Search the Web

Custom Search

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