Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Where do primitive types live?

 
Javier Sanchez Cerrillo
Ranch Hand
Posts: 152
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
--------------------------------------------------------------------------------
It is said that "instance variables" and objects lives in the "Heap" and local variables lives in the "Stack".

But what about primitive types???. Are the same rules are aplied???

class Javier {
int x = 10;
public static void main(String[] args) {
int y = 20;
}
}

Where do x and y live?
 
john cahil
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
x will be on Heap & y on stack
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic