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 temp in java?
What is the difference between member variables initialization and assignment in a constructor?
What does the string method compareto () do?
Is null a keyword in java?
What is the java virtual machine?
If goto and const is reserve words than why it is not work in java?
What does java stand for?
What are peerless components?
Is .net better than java?
Can a class extend 2 classes in java?
Which one will take more memory: an int or integer?
Why singleton is not thread safe?
What is unicode full form?
Why string is a class?
Can a vector contain heterogenous objects?