Pages

Saturday, May 29, 2010

Declear a class in java


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

class Employee {
int age;

double income;
}
  1. By convention, class names capitalize the initial of each word.
  2. For example: Employee, Boss, DateUtility, PostOffice, RegularRateCalculator.
  3. This type of naming convention is known as Pascal naming convention.
  4. The other convention, the camel naming convention, capitalize the initial of each word, except the first word.
  5. Method and field names use the camel naming convention.

No comments:

Post a Comment