+ 1
What are static class member ?
2 ответов
+ 1
Usually, you use static on things that all instances of the class share. Say you make a class for circles to be drawn on the screen. You might want a list that contains all of them and you'd make it static so there was only one list. You could also make a static method that used the list to request each instance draw itself.
0
all object share (one) static class member, becaue in some cases we need all objects of class have the same value of the varable. for example. like (tax) if we have class include member or varable named(tax) so all objects of this class have the same tax.
and the other benift that if we need to change the (tax) we just change the value of static member so all objects can see this change.
hopefully it is clear. thanks