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