Why method overloading called as static or compile-time polymorphism
sample in Java.
class StaticPolymorphismSample {
void polymorphicMethod(int a) {
}
void polymorphicMethod(int a, int b) {
}
void polymorphicMethod(String a) {
}
void nonPolymorphicMethod(int a) {
}
void nonPolymorphicMethod1(int a) {
}
}
so my question is.
Why we say that method overloading ( in this case polymorphicMethod
methods ) are static polymorphism , but another methods( nonPolymorphicMethod(int a)
nonPolymorphicMethod1(int a)
) are not polymorphism.
technically I cannot see different between method with same name and different parameters and method with different, all answers in here and topics in google is not applicable for my question.