In context of the class identifiers the statements have meaning as explained below:
firstly private
and public
keywords are access signifiers, which means all members with private
keyword are only visible in the scope of the class they are declared. All the members with public
keyword are visible outside the scope of the class.
e.g
class foo{
public int myVar;
private int myBar;
}
Now if you instantiate `foo'
foo f = new foo();
f.myVar // is valid
f.myBar // is invalid and generates compile time error.
static
keyword signifies that the allocation of the identifier is common for all instances of the class, so this identifier is allocated at the time when compiler encounters type definition for first time. Since, the type allocation for any class happens only once, there is only one instance of the static field maintained which can be accessed across all objects of this class.
final
keyword signifies (in context of identifiers), that these identifiers can be initialised once and are then closed for any modification.
(in context of methods it means that the method cannot be overridden by the derived classes).
Now coming back to your question, following statements will mean:
private static final int a;
// 'a' has scope local to the class and its value is accessible through Type
// and shared across all instances of that type and its value cannot be
// changed once initialised.
private static int b;
// 'b' has scope local to the class and its value is accessible through Type
// and shared across all instances of that type.
private final int c;
// 'c' has scope local to the class and its value cannot be changed once
// initialised.
private int d;
// 'd' has scope local to the class
public static final int e;
// 'e' has scope beyond the class, it can be accessed outside the class
// through an instance of this class and its value is accessible through
// Type and shared across all instances of that type
// and its value cannot be changed once initialised.
public static int f;
// 'f' has scope beyond the class, it can be accessed outside the class and
// value is accessible through Type and shared across all instances of that
// type
public final int g;
// 'g' has scope beyond the class, it can be accessed outside the class
// through an instance of this class
// and its value cannot be changed once initialised.
public int h;
// 'h' has scope beyond the class, it can be accessed outside the class
// through an instance of this class
Cheers!