Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Programmer Certification (OCPJP)
Where do static variables (class variables) live (scope)?
satya mamillapalli
Ranch Hand
Posts: 63
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Where do they live? stack or heap?
They belong to class not object so does they belong on stack..
Please Advise..
[ August 28, 2005: Message edited by: satya mamillapalli ]
amit taneja
Ranch Hand
Posts: 817
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
object are always be on heap whether its static or not
and static variable will be on stack of Class object which is object of this object ... if i am wrong..pls correct me
Thanks and Regards, Amit Taneja
satya mamillapalli
Ranch Hand
Posts: 63
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Do they live on stack or heap?
Megs Maquito
Ranch Hand
Posts: 84
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
local variables live on the stack, class variables,hmmm if a class is instantiated then the object lives in the heap along with it's instance variables & instance methods be they static or non-static.
I'm a Hood Ornament
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Reference Variables
where do static variables live ?
static variables in multithreading
Where do static variables go?stack/heap
Where do static variables live
More...