Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) 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
Sheriff
Posts: 15753
74
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!!
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!