This tutorial will provide a deep knowledge on class, method, variable and interface Java Naming Convention.
class Employee { }
As a best practice, method name should be mixed case and always start with small case letter.
e.g. -> start(), getEmployeeName(), getEmployeeId()
class Employee {
public void start() {
}
public void getEmployeeName() {
}
public void getEmployeeId() {
}
}
e.g. -> name, age, firstName, lastName
2. variable name should not start with special characters.
3. Static variables name should always be start with capital and separate every word by underscore.
class Employee { String name; int age; String firstName; String lastName; public static String UNIVERSITY_NAME; // static variable }
Specialist Master (Architect) with a passion for cutting-edge technologies like AEM (Adobe Experience Manager) and a proven track record of delivering high-quality software solutions.
📝 Blogs
javadoubts.com © All rights reserved