0
What does/is static
I don't understand what static is or what it does and that bothers me. any help?
3 Respostas
+ 2
Google it
+ 2
In case of static variable , when we define a variable within a class, it is actually generated several times, once in each object we create. Sometimes we want to define variables that are defined once for all objects of a particular type. For example: a variable that contains the number of objects created from a particular class (class). This variable is called a static variable.
A static variable is a variable that has only one instance and is shared by the whole class (as opposed to a regular 'duplicate' variable for each object from the class).
A static variable is found only once in memory, no matter how many object instances the class has.
you could define also methods and classes as static .
0
Thanks, I don't get it 100% but I got something out of it