operands

Quiz Guidelines

 

Descriptive Question

QID: 
49

Predict output:

public class PrefixPostfixCheck {

	public static void main(String[] args) {
		int i=5;
		i=i++;
		System.out.println(i);
	}
}

 

Multiple Choice Question

QID: 
23

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 = 40 ;

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 40

D. It will prints 40 20 40

E. It will prints 0 20 40