what are the functionality of Static variables ? Why Static variables are used in a class? Are Static variables and class variables same?
Static variables are the variables that are shared by all instances of class.
There are situations in which the method?s behavior does not depend on the state of an object. So, there will be no use of having an object when the method itself will not be instance specific. n such a situation, we have to use the static modifier.
Yes, static variables are the class variables.