File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes About the Object reference Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "About the Object reference" Watch "About the Object reference" New topic

About the Object reference

Ramesh Fernando

Joined: Nov 15, 2012
Posts: 2
Hi guys,
I'm pretty new to java.I'm confused about the the meaning of the "Object reference".
I mean why a reference is need? Can some one please help me how the references are stored??

Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15093

Welcome to the Ranch!

Variables* in Java are references - a variable is not the object itself, it's a "pointer", or reference, that tells Java where in memory the object is located.

Have a look at the Cup Size Campfire Story, which explains this in more detail.

* (of non-primitive types)

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Ramesh Fernando

Joined: Nov 15, 2012
Posts: 2
Thank you very much Jesper,for the warmth welcome to the Ranch.
I solved my doubt with the help of the article you have prescribed.
I hope to be with you guys and will try my best to be a good Programmer.I like Java!!
I agree. Here's the link:
subject: About the Object reference
jQuery in Action, 3rd edition