Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Identifier Type

Rules for Naming

Examples

Classes or inner classes

Class names should be nouns, in mixed case with the first letter of each word capitalised. Try to keep your class names simple and descriptive. Use whole words and avoid acronyms and abbreviations.

class Raster;
class TreeFrame;

Interfaces

Interface names should be capitalized like class names.

interface Enumeration;

Methods

Methods should be verbs in mixed case with the first letter lowercase. Within each method name capital letters separate words. Property methods or get-set methods are used as follows:
When a method is used to get a value start the method name with 'get'. When a method is used to set a value start the method name with 'set'.

run(); \\
runFast();
setBackground();

Variables (except for (constant) static final variables and member variables)

All variables are in mixed case with a lowercase first letter. Words are separated by capital letters.

int index;
float myWidth;

Member variables

The same capitalisation as for normal variables prefixed with 'm_'.

int m_index;
float m_myWidth;

Constant (static final) variables

Names should be all uppercase with words separated by underscores ("_").

public static final int BLACK = 99;

Exceptions

Like class names; always ending in "Exception"

InputException

Packages

Lowercase only; avoid lengthy package names; always start with org.apache.felix.

org.apache.felix.demo.bundle

...