adding method ,inheritance,polymorphism