Java Coding Standards
To develop the java program generally we are using the following programming elements like classes, interfaces, enums, methods, variables, packages, constants etc..
Java is case sensitive programming language so must be follow coding standards.
Java is case sensitive programming language so must be follow coding standards.
Class Names:
In java all the class names must be starts with uppercase letters.
If the class name contains multiple words then every inner word must be start with uppercase letter.
for example :- String, StringBuffer, BankAccount, etc..
Interface Names and Enum Names:
In java all the class names must be starts with uppercase letters.
If the class name contains multiple words then every inner word must be start with uppercase letter.
for example :- Serializable, Clonable, etc..
Method Names:
In java all the methods names must be starts with lowercase letters.
If the class name contains multiple words then every inner word must be start with uppercase letter.
for example :- getStudent(), isEmpty(), setAccountDetails(), etc..
Variable Names :
In java all the variable names must be starts with lowercase letters.
If the class name contains multiple words then every inner word must be start with uppercase letter.
for example :- int studentID=1001, String studentName="mahesh", etc..
Package Names :
In java all the package names must be starts with lowercase letters only.
for example :- java.io, lava.lang, java.util, etc..
Constant Names :
In java all the constant names must be starts with uppercase letters only. If constant name contains the multiple words separate with underscore symbol ( _ ).
for example :- MAX_VALUE, MIN_VALUE, etc..
NOTE :
ALL ABOVE RULES AND REGULATIONS ARE MANDATORY FOR PREDEFINED PROGRAMMING ELEMENTS BUT NOT MANDATORY FOR USER DEFINED PROGRAMMING ELEMENTS.ALWAYS RECOMMENDED TO FOLLOW THE RULES AND REGULATIONS FOR USER DEFINED PROGRAMMING ELEMENTS ALSO.