my dog learned polymorphism*
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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 327

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.
wood burning stoves
subject: varialbe storing
Similar Threads
save random numbers
Contract First Service - WSDL to JAX-WS service
need some help please with project
Threads - Run and Start methods.
Why so?