Submitted by heartin on Fri, 10/09/2015 - 20:23
Predict output:
public class PrefixPostfixCheck {
public static void main(String[] args) {
int i=5;
i=i++;
System.out.println(i);
}
}
Submitted by heartin on Tue, 09/08/2015 - 09:03
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