Showing posts with label write class name in java. Show all posts
Showing posts with label write class name in java. Show all posts

Saturday, December 17, 2016

JAVA Naming Conventions

JAVA Naming Conventions:

--------------------------------------------------------------------------------------------------------------------------

JAVA is strictly a case sensitive programming language, where in JAVA application, there is a separate recognition for lower case letter and upper case letters.

In JAVA application to use lower case letters and upper case letters separately, JAVA has provided the following conventions-

1. All JAVA class names, abstract class names, interface names and enum names must be started with upper case letters and the subsequent symbols must also be upper case letters.

EX:
------
String (1 word)
StringBuffer (2 word)
InputStreamReader(3 word)

2. All JAVA variable name must be started with lower case letters but the subsequent symbols must be upper case letters.
EX:
-------
in, out, err             (1 word)
faceContext, bodyContent (2 words)

3. All JAVA method names must be started with lower case letters but the subsquent symbols must be upper case letters.
EX:
------
concat(-)
forName(--)
getInputStream(---)

4. All JAVA constant variables must be provided in upper case letters.
EX:
-------
MIN_PRIORITY
NORM_PRIORITY
MAX_PRIORITY

5. All JAVA package names must be provided in lower case letters.
EX:
------
java.io
java.awt.event
java.servelet.jsp.tagext



Note: All the above conventions are mandatory for predefined library, which are optional for used defined library, but suggestible.