Method overloading with object as parameter