Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialSina Maleki
6,135 PointsObject reference
Hi guys I'm confused about "object references" in this course. I hope you'll help me. Best
4 Answers
Sina Maleki
6,135 PointsI found the good example on the link below.
http://www.c4learn.com/java/java-assigning-object-reference/
JT Keller
12,731 Points- An Object is an instance of a Class, it is stored somewhere in memory
- A reference is what is used to describe the pointer to the memory location where the Object resides.
- A variable is a means by which you can access that memory location within your application (its value is "variable"). While a variable can only point to a single memory address (if its not null), it may change and point to different locations through out the life cycle of the application
Sina Maleki
6,135 PointsI wanna know some definition about it
Paul Yorde
10,497 PointsHey Sina, so an object reference gives us a way to access properties and methods associated with a specific object. Often, it will be stated as just passing an object. It means the same thing, it's just that technically speaking we don't work with objects, but instead we work with a reference to the object, which is to say an object reference. If you understand what it means to pass an object, then you understand what it means to pass a reference to object; at least for the sake of understanding what's going on.
Note however, understanding a reference is fundamental to object oriented programming.
Hope that helps. Best ~
miguelcastro2
Courses Plus Student 6,573 Pointsmiguelcastro2
Courses Plus Student 6,573 PointsWhat exactly are you confused about?