Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

why stack or heap why not any one

Arun Maalik
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Ranchar

As we know that instance variable and object are stored on the heap memory where as local variable and method are stored on the stack.

But here i am thinking that why these difrence has been made that some are stored on heap and some are stored on stack. why not these are stored either on stack or heap. what benfit we will get by creating heap or stack.
please specify me.

with regard

Arun kumar maalik
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!