|
|
350 Mock Questions on SCJP 1.5 - JUST Rs.200 or 7 USD
Send us mail to sales@javabeat.net
more details
|
|
SCJP 5.0 Mock Exam -3
10) What will be the output of the following program?
package scjp5_0.chap03;
public class Ques09 {
public static void main(String[] args) {
Integer a = null;
a = new Integer(10);
int b = 20;
a = b;
a = 30;
System.out.println(a++);
short s = 100;
a = s;
System.out.println(a--);
}
}
- The program won't compile.
- The program will throw a run-time exception.
- The program will output '31 100'
- The program will output '31 99'
Answer:
10) a.
The program won't compile since an explicit cast is needed for the assignment of short to an Integer object.
|
|
350 Mock Questions on SCJP 1.5 - JUST Rs.200 or 7 USD
Send us mail to sales@javabeat.net
more details
|
|