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
Submitted by heartin on Sun, 08/23/2015 - 07:41
Which of the following statements are true?
Select 1 option
A. For any non-null reference obj, the expression (obj instanceof obj) will always yield true.
B. For any non-null reference obj, the expression (obj instanceof Object) will always yield true.
C. For any non-null reference obj, the expression (obj instanceof obj) will always yield false.
D. For any non-null reference obj, the expression (obj instanceof Object) may yield false.
E. None of the above