Naming Conventions


By using standard Java naming conventions, you make your code easier to read. The following key rules must be followed by every identifier: Camel-Case in Naming Conventions
Classes, interfaces, methods, and variables follow the camel-case syntax. If the name is combined with two words, the second word will start with a uppercase letter like actionPerformed(), firstName, and ActionEvent.

Packages
  • It should use lowercase letters such as java and lang.
  • If the name contains multiple words, it should be separated by dots (.) such as java.util and java.lang.

package com.javapoint; 
public class Employee {  
  // code snippet  
}
Classes
  • It should start with a uppercase letter.
  • It should be a noun such as Color, Button, System, Thread, etc.
  • Use appropriate words, instead of acronyms.

public class Employee {  
  // code snippet  
}
Interfaces
  • It should start with a uppercase letter.
  • It should be an adjective such as Runnable, Remote, and ActionListener.
  • Use appropriate words, instead of acronyms.

interface Printable {  
  // code snippet  
}