Capgemini Engineering interview question

Implement polymorphism concept in Java