lecture-25 - Passing and Returning Objects • Passing and...

Info iconThis preview shows pages 1–12. Sign up to view the full content.

View Full Document Right Arrow Icon
Object Oriented Programming Java - Defining Own Classes R.B. Lenin Winter - 2006 DA-IICT 51 Passing and Returning Objects • Passing and returning objects follow the same process as passing and returning primitive data types. • The only difference is that with objects, the value being passed is the reference (or address) to an object.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Object Oriented Programming Java - Defining Own Classes R.B. Lenin Winter - 2006 DA-IICT 52 Passing and Returning Objects • When a variable is an object name, the value of the variable is the address in memory where the object is stored. • The effect of passing this value, or reference, is to have two variables (object names) referring to the same object.
Background image of page 2
Object Oriented Programming Java - Defining Own Classes R.B. Lenin Winter - 2006 DA-IICT 53 Pet Class
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Object Oriented Programming Java - Defining Own Classes R.B. Lenin Winter - 2006 DA-IICT 54
Background image of page 4
Object Oriented Programming Java - Defining Own Classes R.B. Lenin Winter - 2006 DA-IICT 55
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Object Oriented Programming Java - Defining Own Classes R.B. Lenin Winter - 2006 DA-IICT 56
Background image of page 6
Object Oriented Programming Java - Defining Own Classes R.B. Lenin Winter - 2006 DA-IICT 57
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Object Oriented Programming Java - Defining Own Classes R.B. Lenin Winter - 2006 DA-IICT 58
Background image of page 8
Object Oriented Programming Java - Defining Own Classes R.B. Lenin Winter - 2006 DA-IICT 59
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Object Oriented Programming Java - Defining Own Classes R.B. Lenin Winter - 2006 DA-IICT 60 Passing Objects to Methods
Background image of page 10
Java - Defining Own Classes R.B. Lenin Winter - 2006 DA-IICT 61
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 12
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/15/2010 for the course CSE IT115 taught by Professor Rblenin during the Spring '10 term at Punjab Engineering College.

Page1 / 30

lecture-25 - Passing and Returning Objects • Passing and...

This preview shows document pages 1 - 12. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online