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
(1)
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.