What is the difference between static and non-static
variables?
Answer Posted / santosh mundhe
Static:1)Memory allocated before creation of object.
2)Gets memory on Global segment.
3)Object can't get copy of static variable, each
object shears static variable from global segment.
4)Static variables are not part ob object.
Non-static:
1)Gets memory on satck segment.
2)Object gets copy of non static variable.
3)Non static variables are part of object.
Is This Answer Correct ? | 8 Yes | 7 No |
Post New Answer View All Answers
What is dynamic array in java?
What happens if a try-catch-finally statement does not have a catch clause to handle an exception that is thrown within the body of the try statement?
Does collectionutils isempty check for null?
What are keywords give examples?
What is public/private protected in java?
What are java threads?
How do you use equal in java?
What is a instance variable?
What does a method signature consist of?
State one difference between a template class and class template.
What does sprintf mean?
Can we increase size of array?
Explain how to convert any java object into byte array.
List out benefits of object oriented programming language?
How to display all the prime numbers between 1 and 100