Abstract class use in polymorphism