+ 1

I don't understand how static works

I don't see the point of it and how it works. I am very confused. could someone explain it in other words please?

30th Nov 2017, 2:54 PM
Dean Ghassemi
Dean Ghassemi - avatar
2 Réponses
+ 1
Static variables - means that there is only one variable for whole class. So if you create diffrent object of the same class, then when you modify static variable it will change value also for diffrent objects. if variaable is non static then every objects holds it's own variable.
30th Nov 2017, 3:03 PM
Bartek Nowacki
Bartek Nowacki - avatar
+ 1
static nested class - it means that you can't create objects from this class. But for this class is still early for you so more you can read when tou will understand more basic concepts
30th Nov 2017, 3:12 PM
Bartek Nowacki
Bartek Nowacki - avatar