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

 
 

Share on Google+Share on Google+
SCJP Module-6 Question-25
Posted on: July 15, 2010 at 12:00 AM
Advertisement
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)

Advertisement

Related Tags for SCJP Module-6 Question-25:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: July 15, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com