Ola pessoal , bom dia estou estou com uma duvida e não consegui entender essa questão;
Diz que o erro esta em “Arrays.sort(myObjects);” que gera um CastException alguem pode me dar uma
orientação !!! Vlw!!
public class Question_11 {
public static void main(String[] args) {
Object[] myObjects = {new Integer(12), new String("FOO"), new Integer(5), new Boolean(true)};
Arrays.sort(myObjects);
for (int i = 0; i < myObjects.length; i++) {
System.out.print(myObjects[i].toString());
System.out.print("");
}
}
}