Naming Conventions
- The name should not contain white spaces
- They should not start with special characters
Class
- Should start with an uppercase
- They should be a noun
- use appropriate words instead of acronyms
Interface
- It should start with an uppercase letter
- Should be an adjective
- Use appropriate words like acronyms
Method
It should start with a lowercase letter
It should be a verb main(), print(), println()
if the name contains multiple words, start it with a lowercase letter followed by an uppercase letter such as actionPerformed().
It should be a verb main(), print(), println()
if the name contains multiple words, start it with a lowercase letter followed by an uppercase letter such as actionPerformed().
Variable
It should start with a lower case letter such as id, name.
It should not start with special characters
If the name contains multiple words, camelCase
Avoid using one character variables like x,y,z
It should not start with special characters
If the name contains multiple words, camelCase
Avoid using one character variables like x,y,z
Package
It should be a lowercase letter such as java, lang
if the name contains multiple words, it should be separated by dots. Such as java.util, java.lang
if the name contains multiple words, it should be separated by dots. Such as java.util, java.lang
Constant
It should be in uppercase such as RED, YELLOW, BLUE
if the name contains multiple words, it should be separated by an underscore RED_YELLOW or MAX_PRIORITY.
if the name contains multiple words, it should be separated by an underscore RED_YELLOW or MAX_PRIORITY.
Camel Case in java
Use it in all naming conventions.