Polymorphism is the ability to take many forms. Method overriding is runtime polymorphism.
My questions are:
Is there anything like static polymor
If we run this test
class A {
static void x() {
System.out.println("A");
}
}
class B extends A {
static void x() {
System.out.println("B");
}
}
class Test {
public static void main(String[] args) throws Exception {
A a = new B();
a.x();
}
}
it will print A. If method x() were polymorphic, it would print B.