Cognizant interview question

Polymorphism and how to code it using c++ or java!