ATMECS interview question

Write code for polymorphism.