Updated Inheritance, Encapsulation and polymorphism Example