I don't know what the problem is with the following code? In IntelliJ, at compile-time, an error occurs to the compareTo method and says that this method does not exist in the Number class.
Number x = new Integer(3);
System.out.println(x.intValue());
System.out.println((Integer)x.compareTo(new Integer(4)));
Doesn't it convert to an Integer object first and then the method is called?