Lecture 6
Defining your own class
Exceptions
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Returning an Object from a Method
As we can return a primitive data value from a method, we can return an object from a method also.
We return an object from a method, we are actually returning a reference (or an address) of an object.
This means we are not returning a copy of an object, but only the reference of this object.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display