What are the differences between instance, class and static variable?

0 votes
asked by about BlueJ
edited by

What are the differences between instance, class and static variable?

1 Answer

0 votes
No avatar answered by (25.4k points)
edited by

An instance variable is a variable defined in a class, for each object of the class that has a separate copy. A class variable is a variable defined in a class of which a single copy exists. In programming languages like Java, C#, and C++, a static variable is a variable that has been allocated statically.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register
...