This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes why instance variable on heap? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "why instance variable on heap?" Watch "why instance variable on heap?" New topic

why instance variable on heap?

Arun Maalik
Ranch Hand

Joined: Oct 25, 2005
Posts: 216
Dear sir would you please explain me that why

---->Instance variable and object live on heap?
----->Local variable and method live on stack?

As we know that heap created on run time wheras stack form on compile time and i think that instance variable and object form on run time where as local variable and method form on compile time. I think due to this but i am not sure so please specify me.


Arun kumar maalik
I agree. Here's the link:
subject: why instance variable on heap?
It's not a secret anymore!