Java Naming rules suggests which one to be used.
This
public static final class DatabaseTable
or, this
public static final class DATABASE_TABLE
Which one is correct?
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.
There is no such thing as “incorrect” here, in the sense that the Java compiler or syntax of the language does not force you to use specific naming conventions.
If we look at the old Code Conventions for the Java Programming Language document, specifically Chapter 9 – Naming Conventions, we see that classes should have CamelCaseNames:
It doesn’t matter if the class is a nested class (
static) or if the class isfinal.ALL_UPPERCASE_NAMES are for constants;
static finalvariables (not classes).