|
What is a static variable |
|
|
A static variable, also referred to as a class variable, is a variable which exists across instances of a class.
The opposite of a static variable is an instance variable, which is a variable related to a single instance of a class. Each time an instance of a class is created, the system creates one copy of the instance variables related to that class.
By default, all variables are created as instance variables. To make a class variable, you must explicitly declare the variable static.
Related Tips
|
Page 1 of 0 ( 0 comments )
You can share your information about this topic using the form below!
Please do not post your questions with this form! Thanks.