Home Tutorial Java Scjp Part6 SCJP Module-6 Question-25

 
 

SCJP Module-6 Question-25
Posted on: July 15, 2010 at 12:00 AM
The program given below will test your understanding about the Wrapping classes and parsing object value using wrapper classes in Java.

Given below the sample code :

class ObjectClass {
public static void main(String args[]) {
Object[] ObjectsPack = { new Integer(12), new String("zoo"),
new Integer(5), new Boolean(true) };
Arrays.sort(ObjectsPack);
for (int i = 0; i < ObjectsPack.length; i++) {
System.out.print(ObjectsPack[i].toString());
System.out.print(" ");
}
}
}

What will be the output of the following code ?

1. 12  zoo  5 

2. 12  zoo  5  true

3.compilation error.

4.No output

Answer

(3)

Related Tags for SCJP Module-6 Question-25:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.