class Employee{
// salary variable is a private static variable
private static double salary;
// DEPARTMENT is a constant
public static final String DEPARTMENT =
public static - can be accessed from within the class as well as outside the class.
private static - can be access from within the class only.
Static's are considered to be anti-OO in OOPS.
class Dog
{
public static string X;
private static string y;
}
y can be accessed only from inside Dog via either Dog.y or just y.
X can be accessed anywhere via Dog.X or, if you're either in the class or using using static Dog as a header, just X.