Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Performance
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
Tim Cooke
Ron McLeod
Jeanne Boyarsky
Paul Clapham
Sheriffs:
Liutauras Vilda
Henry Wong
Devaka Cooray
Saloon Keepers:
Tim Moores
Stephan van Hulst
Tim Holloway
Al Hobbs
Carey Brown
Bartenders:
Piet Souris
Mikalai Zaikin
Himai Minh
Forum:
Performance
Memory problem with uninitialized static member variable
Mathew Kuruvilla
Ranch Hand
Posts: 145
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi, I was asked an interview question.
"What is the memory implications if the static member in a Class is not initalized"
I replied that static members are initialized to null. Clearly this was wrong, because
he went on to his next question . . .
Lakshman Arun
Ranch Hand
Posts: 52
1
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Class variables(static variables), Objects datamembers(non-primitive) are assigned to null by default. Assigned to the corresponding default values(0 or false) if its primitive.
Regards
Lakshmanan
Lakshmanan Arun
http://devtoolzone.com
Mathew Kuruvilla
Ranch Hand
Posts: 145
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
That is what I thought. Thanks.
I'm sure glad that he's gone. Now I can read this tiny ad in peace!
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Garbage Collection
Thread question
static variables in multithreading
volatile and static keywords
A member interface is implicitly static
More...