In Java, what is the purpose of a private static variable?

kulluM

New member
If a variable is specified as public static varName;, I may access it as ClassName.varName from anyplace. I'm also aware that static members are shared by all instances of a class and are not allocated differently in each instance.
Is there any difference between defining a variable as private static varName; and declaring a variable as private varName;? It cannot be accessed as ClassName.varName or ClassInstance.varName from any other class in either circumstance.
I've read this post and searched through various sites and still can't figure it out. Could someone please assist me? Does defining the variable as static endow it with any additional properties?
 
Top