Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

06. Java Coding Guidelines By Mr.

Vishnu

Java Coding Guidelines

1. Basic Naming convention standards:

To describe variable/constant/method/class/interface etc use full descriptor.

E.g.:rollNumber, firstName, lastName, getTotalMarks().

2. Naming variable:

Use first word in small letters and all remaining words will be capitalized.

E.g. –rollNumber, firstName.

3. Naming Constants:

Use all letters in upper case.

E.g. –MAX_MARKS.

4. Naming methods:

a). Naming member methods :

Use first word in small letters and all remaining words will be capitalized.

E.g. –getTotalMarks().

b). Naming accessor methods:

for getters – use get as prefix to property (for non Boolean properties).

e.g. –getRollNumber().

for setters – use set as prefix to property.

e.g. –setRollNumber().

use is as prefix to property(for Boolean properties).

e.g. –isNewStudent().

5. Naming class/interface:
1
Sri Sureka Technologies, NearAndraBank,OppositeGeethanjali High School, Near
S.R.NagarUmeshChandraStachu, S.R.Nagar, Hyderabad-500038, Ph: 040-66616677, Mobile: +91-
9885602332.
06. Java Coding Guidelines By Mr. Vishnu

Use capitalized words for class/interface name.

E.g.-HelloWorld.

6. Comment:

For clarity of the code add comments.

2
Sri Sureka Technologies, NearAndraBank,OppositeGeethanjali High School, Near
S.R.NagarUmeshChandraStachu, S.R.Nagar, Hyderabad-500038, Ph: 040-66616677, Mobile: +91-
9885602332.

You might also like