Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About the Object reference

 
Ramesh Fernando
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15207
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
 
Ramesh Fernando
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic