Possible Duplicate:
Java modifiers syntax and format
Is it private static final or private final static. I do understand that both of them work, but would like to know the order in which the spec declares it.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The order of access modifiers doesn’t matter. They just have to be present.
For method modifiers, the Java language spec notes, that it is it is customary,
though not required, that they appear in the order consistent with that shown
above in the production for MethodModifier., which is:
Addition
recommended order for field modifiers (as of JLS 8.3.1):
recommended order for class modifiers (as of JLS 8.1.1):
(Annotation) is not a modifier, it’s a placeholder for any annotation. Annotations should be put before any other modifier.