Tuesday, 26 May 2015

Java Naming Conventions

Java Naming Convention is a rule to follow as you decide what to name your identifiers such as class, package, variables, constants, methods ext. But, it is not forced to follow, it is known as conventions not rule.







Advantages of naming conventions in java


          By using standard java naming conventions you make your code easier to read for yourself and for other programmers. Readability of java program is very important. It indicates that less time is spent to figure out what the code does.

                                      The following are the some of the Java Naming Conventions.

  The class name should start with uppercase letter and be a noun.
The interface should start with uppercase letter and be an adjective.
Method names should start with lowercase letter and be verb.
Variable name should start with lowercase letter.
Package name should be in lowercase letter.
Constant name should be in uppercase letter.

         Java follows camelcase  syntax for naming the class, interface, method and variables. If name is combined with two words, second word will start with uppercase letter always.

        Example: firstName, helloWorld

0 comments:

Post a Comment

Scribe to Youtube Channel

Advertisement

Find Us On Facebook

C Programming

More

C++ Tutorial

More

Java Tutorial

More

software engineering

More

MS Office

More

Database Management

More
Top