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 varialbe storing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "varialbe storing" Watch "varialbe storing" New topic

varialbe storing

Harshana Dias
Ranch Hand

Joined: Jun 11, 2007
Posts: 331

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

Joined: Nov 21, 2007
Posts: 41
Please refer.
Ulrika Tingle
Ranch Hand

Joined: Nov 24, 2009
Posts: 92
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.
I agree. Here's the link:
subject: varialbe storing
It's not a secret anymore!