Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Where do local variables in static methods live?

 
Dennis Diment
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Static methods and static variables are loaded when the class is loaded. This means both go on the heap. Right?

How about local variables in static methods? Is a stack frame generated for static methods? Why else do they not get default values? (I'm not a CS major )

Dennis
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the Intermediate forum...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic