Can anyone tell how many Non-access Modifiers there are in Java? I have the list below, but I want to know if it is complete or if there's any other I need to add:
final,
abstract,
static,
strictfp,
native,
synchronized,
transient
Can anyone tell how many Non-access Modifiers there are in Java? I have the list below, but I want to know if it is complete or if there's any other I need to add:
final,
abstract,
static,
strictfp,
native,
synchronized,
transient
It's always best to go to the source: The Java Language Specification. Looking at the keyword section, you can get this list:
I don't think Michael Bar-Sinai's answer is correct.
The Modifier class shows a total of 12 modifiers, and this page of the Java Documentation shows that there are 3 access modifiers (and a 4th nameless package-private modifier). It follows that the 9 non-access modifiers are: