publicclassDynamicDispatch{staticabstractclassHuman{protectedabstractvoidsayHello();}staticclassManextendsHuman{@OverrideprotectedvoidsayHello(){System.out.println("man say hello");}}staticclassWomanextendsHuman{@OverrideprotectedvoidsayHello(){System.out.println("woman say hello");}}publicstaticvoidmain(String[]args){Humanman=newMan();Humanwoman=newWoman();man.sayHello();woman.sayHello();man=newWoman();man.sayHello();}}