This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

varialbe storing

 
Harshana Dias
Ranch Hand
Posts: 331
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

Primitives and Object reference are store in stack right.

Suppose int i=6;

Then this should save in stack know..but where is i and 6 save? is it like both save in stack separately where i refer to 6? (e.g: i->6)

Thank You.
 
chandrakant karale
Ranch Hand
Posts: 41
 
Ulrika Tingle
Ranch Hand
Posts: 92
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Harshana Dias wrote:
Primitives and Object reference are store in stack right.


Do really need to know that now? Who cares "where" things are stored. What's important is that you know what happens, that the i variable gets assigned a 6.

If you're just learning Java you can do perfectly fine without things like stack and heap. They're not part of the language. They're supposed to help you understand stuff but if you feel they're not helping just forget about them. Above all, don't let them be a hindrance.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic