Multiple Choice Question

Quiz Guidelines

 

QID: 
406
Tags: 
Question: 

What will the following program print?

public class TestClass{
public static void main(String[] args){
String str = "111";
boolean[] bA = new boolean[1];
if( bA[0] ) str = "222";
System.out.println(str);
}
}

Select 1 option

A. 111
B. 222
C. It will not compile as bA[0] is uninitialized.
D. It will throw an exception at runtime.
E. None of the above.

Q&A Set: 

Search the Web

Custom Search

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