What Is a Java Class?

Classes are the fundamental building blocks of a Java program. You can define an Employee class as follows:

class Employee {

  int age;

 

  double salary;

}

By convention, class names capitalize the initial of each word.

For example: Employee, Boss, DateUtility, PostOffice, RegularRateCalculator.

This type of naming convention is known as Pascal naming convention.

The other convention, the camel naming convention, capitalize the initial of each word, except the first word.

Method and field names use the camel naming convention.