Every predefined class, interface, method etc. will follow the java coding conventions and we are recommended to follow the same conventions. It is always a good programing practice to develop a program by following the coding conventions.
1) Conventions for class
A class name can contain any number of words and the first letter of every word should be specified in uppercase.
Example: System ,StringBuffer ,SecondProgram
2) Convention for Interface:
An interface name can contain any number of words and the first letter of every word should be specified in uppercase.
Example: Runnable, ActionListener, MyInterface
3) Convention for a method
A variable name can contain any number of words and the first word should be specified completely in lowercase. The first letter if the remaining words if available should be specified in uppercase.
Example: main() , toCharArray() ,areaOfSquare()
4) Convention for a varibale
A variable name can contain any number of words and the first word should be specified completely in lowercase. The first letter if the remaining words if available should be specified in uppercase.
Example: length , namberOfStudents ,accountNumber
5) Convention for constant:
A constant can contain any number of words. All the letters of all the words should be specified in uppercase, if multiple words are available then separate them ny underscore(_)
Example: MIN_VALUE, MAX_VALUE, PI
6) Convention for a package
A package name should be specified completely in lowercase.
Example: java.lang, java.net, com.androindain