I want to implement dynamic polymorphism in python like in java. Is it possible? if yes please guide me how.I want to implement something like this:
class A {
public void show() {
System.out.println("Base class");
}
}
class B extends A{
public void show() {
System.out.println("Derived class");
}
}
class C {
public static void main(String args[]) {
A a = new B();
a.show(); // so it will call B's show method.
}
}
Bclass to be derived fromA? Because the code says it's not.