In the above program, Object obj1 is passed from main() method to copy() method.In copy() method, variables of obj1 are copied to object obj2 (because the method is invoked by obj2).Actually passing of object does not mean the whole object is passed but just a reference of the object is passed.