Implementing Inheritance to understand the theory and polymorphism in it