Hey here is a great help
A static variable is intilized when the class is loded. Which means that
the static variable will have the same value regardless of the number of
objects we create from that class. And the value of that static variable is the same in all objects of that class.
Example let say there is a static variable x in class animal
lets say we create an object called cat from the class animal and also an object dog.
the value of the vairable x is the same in both cat and dog always.
if we make
cat.x=9
then the x in dog will also be 9.
Hence, static variables can be used to share a common information
between objects of the same class. For example the number of legs is
common to both cats and dogs
> the value of the vairable x is the same in both cat
> and dog always.
> if we make
>cat.x=9
> dog will also be 9.
And the whole point is: static variables are not related to class's objects, and they are not supposed to be accessed through an object reference.