0% found this document useful (0 votes)
26 views1 page

Naming Convention

The document discusses Java naming conventions, which provide rules for naming identifiers like classes, packages, variables, and methods to make code more readable. Following standard conventions means code is easier for programmers to read and understand, saving time spent figuring out what the code does. Classes should begin with uppercase nouns, interfaces with uppercase adjectives, methods with lowercase verbs, variables with lowercase names, packages in lowercase, and constants in uppercase.

Uploaded by

suhas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views1 page

Naming Convention

The document discusses Java naming conventions, which provide rules for naming identifiers like classes, packages, variables, and methods to make code more readable. Following standard conventions means code is easier for programmers to read and understand, saving time spent figuring out what the code does. Classes should begin with uppercase nouns, interfaces with uppercase adjectives, methods with lowercase verbs, variables with lowercase names, packages in lowercase, and constants in uppercase.

Uploaded by

suhas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Naming convention

A naming convention is a rule to follow as you decide what to name your identifiers
(e.g. class, package, variable, method, etc.), but it is not mandatory to follow that
is why it is known as convention not rule.

Advantage:

By using standard Java naming conventions they make their code easier to read
for themselves and for other programmers. Readability of Java code is important
because it means less time is spent trying to figure out what the code does.

should begin with uppercase letter and be a noun


class name
e.g.String,System,Thread etc.

Interface should begin with uppercase letter and be an adjective


name (whereever possible). e.g. Runnable,ActionListener etc.

method should begin with lowercase letter and be a verb. e.g.


name main(),print(),println(),actionPerformed() etc.

variable should begin with lowercase letter e.g. age,


name firstName,orderNumber etc.

package
should be in lowercase letter. e.g. java,lang,sql,util etc.
name

constants should be in uppercase letter. e.g. RED,YELLOW,MAX_PRIORITY


name etc.

You might also like