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
How do you create a bulleted list?
What is arraylist e in java?
Explain about arraylist?
What is vector?
Is null a keyword in java?
What is object cloning in Java?
Which data type is class in java?
Why are the methods of the math class static?
How do you replace all in word?
What is included in core java?
What a static class can contains?
Difference between start() and run() method of thread class?
You're given a Boolean 2D matrix, can you find the number of islands?
What is the char data type?
What are the advantages of java inner classes?