The following two syntax orderings are valid within Java. Why are both allowed and is there a preferred syntax order?
private final static String consultantType = "consultantType";
private static final String consultantId = "consultantId";
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.
Any order is allowed because there is no value in restricting the order, so why bother imposing the burden of remember a spurious ordering on the programmer?
It makes absolutely no difference whatsoever which order you use. Pick the one you prefer, use it consistently, and move on to a more interesting problem.
For what it’s worth, I think “private static final” is probably more common.