• Post Reply Bookmark Topic Watch Topic
  • New Topic

Stack and Heap!!!  RSS feed

 
Brian Smith
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
could you please tell me what are differences between Stack and Heap in Java? are they created in RAM or Hard Drive?
thanks.
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Namaste Sathi:
hi all,
could you please tell me what are differences between Stack and Heap in Java? are they created in RAM or Hard Drive?
thanks.


The Heap is where all object instances are stored and Stack are where all method locals are stored. RAM or Hard Drive depends on the OS. Generally speaking it would be RAM, but since most modern OSs use virtual memory, some could be temporarily stored on the Hard Drive.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!