Effective way of writing Java Programs With coding standards

Naming Convensions:

Whenever we are writing the code it is highly recommended to follow coding conventions the name of the method or class should reflect the  purpose of functionality of that component.





Coding standards for classes:

Using Class names are nouns, should start with Uppercase letter and if it contains multiple words every inner word should start with an uppercase letter.
Eg:
        String,
        Customer,
        Arrays,
        FileInputStreamReader and  etc..

Coding Standards for Interfaces:

Using interfaces names is Adjectives should start with Uppercase letter and if it contains multiple words every inner word should start with an uppercase letter.
Eg:
        Runnable,
        Serializable,
        Cloneable and etc..
Note: Throwable is a class but not an interface. It acts as a root class for all Java Exceptions and Errors.

Coding Standards for Methods:

Using method names are either verbs or verb noun combination should starts with lower case letter and if it contains multiple words every inner word should starts with upper case letter
Eg:
        run(),
        sleep(),
        getClass(),
        getSalary() and etc...

Coding Standards for Variables:

Usually the variable names are nouns should starts with lower case character and if it contains multiple words, every inner word should starts with uppercase character.
Eg: 
        rollno,
        mobileNumber,
        studentName and etc...

Coding Standards for Constants:

Usually the consonants are nouns should contain only uppercase character if it contains multiple words these words are separated with "_" symbol.We can declare consonants by using static and final modifiers.
Eg:
       MAX_VALUE,
       MIN_VALUE and etc...

Java Bean Coding Standards:

A java bean is simple java class with private properties and public getter and setter methods.
Eg:
public class Coding
{
    private String studentName;
    public void setName(String studentName)
    {
        this.studentName=studentName;
    }
    public String getName()
    {
        return studentName;
    }
}

Syntax for setter method:

The method name should be prefix with "set" compulsory the method should take some arrangement return type should be void.

Syntax for getter method:

the method name should be prefixed with 'get'.It should be no arrangement method.Return type should not be void.
Note: For the Boolean property the getter method can be prefixed with either get or is recommended to use 'is'.
Eg: private boolean empty;
public boolean getEmpty()
{
    return empty;
}
public boolean isEmpty()
{
    return empty;
}

Coding standards for Listeners:

To register a listener:

Method name should be prefixed with add, after adding whatever we are taking the arrangement should be same.
Eg:
             1. public void addMyActionListener (MyActionListener l)
             2.public void registerMyActionListener(MyActionListener l)
             3. public void addMyActionListener (Listener l)

To Unregister a listener:

The rule is same as above,except method name should be prefix wtih remove.
            1. public void removeMyActionListener (MyActionListener l)
            2. public void unregisterMyActionListener(MyActionListener l)
            3. public void deleteMyActionListener (Listener l)
            4.public void removeMyActionListener(ActionListener l)