Welcome to JavaRanch
There is no such thing as compile-time polymorphism.
At least I don't think there is. I think polymorphism means you can call methods on objects of different types, and the methods behave as in the target. For example
behaves according to the type of myFoo. That depends on the type of the object called. You get whatever
myFoo has as its
toString() method. Even if you declared myFoo to be of type
Object, you get the overridden version of
toString().
Overloading is different
. . . all call the
out object, which is actually a
PrintStream. You are getting different methods called, but all on the same object (therefore all on the same type of object). So the difference does not depend on the "target" object; it depends on the calling method, passing an
int, a
long, a
double, a
BigInteger, and a
BigDecimal in turn. So, if "polymorphism" means different behaviour depending on the called object, then overloading isn't polymorphism. Overloading depends on the type of argument passed by the calling method.
Click on the
word polymorphism where it is underlined, and you get some more useful information