method of overriding and overloading