Following Java naming convention, which of the following would be the best name for a class about store customers?

Following Java naming convention, which of the following would be the best name for a class about store customers?

a) StoreCustomer
b) Store Customer
c) storeCustomer
d) STORE_CUSTOMER
e) Store-Customer

Answer:  a.

Explanation:  The Java naming convention states that classes should all start with an upper case letter and that multiple-word names should start each new name with an upper case letter while the remaining characters are lower case.  Words should either be connected together without spaces, or connected with the “_” character.  Answers b and e are not legal names, and using Java naming convention, c would qualify as a variable name and d would qualify as a constant.


Java

Learn More Multiple Choice Question :