Home Tutorial Java Scjp Part9 SCJP Module-9 Question-15

 
 

SCJP Module-9 Question-15
Posted on: July 17, 2010 at 12:00 AM
Advertisement
The Sample code will test your understanding about the Object class of Java.

Given below the sample code :

33. Object [] Obj = {
34. new Integer(12),
35. new String("foo"),
36. new Integer(5),
37. new Boolean(true)
38. };
39. Arrays.sort(Obj);
40. for(int i=0; i<Obj.length; i++) {
41. System.out.print(Obj[i].toString());
42. System.out.print(" ");
43. }

What will be the output of the above code ?

1. ClassCastException at line 39.

2. Error at line 33

3. Error at line 41

4. 12 foo 5 true

Answer

(1)

Advertisement

Related Tags for SCJP Module-9 Question-15:


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 17, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com