This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Customer Requirements for Developers and have Marcho Behler on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Where do primitive types live? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Where do primitive types live?" Watch "Where do primitive types live?" New topic

Where do primitive types live?

Javier Sanchez Cerrillo
Ranch Hand

Joined: Aug 02, 2006
Posts: 152
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?

SCJP 5.0 95%<br /> <br />The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge.
john cahil

Joined: Jul 26, 2006
Posts: 12
x will be on Heap & y on stack
wood burning stoves
subject: Where do primitive types live?
It's not a secret anymore!