Home > Articles > CamelCase Notation- Naming Convention for Programming Languages

CamelCase Notation- Naming Convention for Programming Languages

CamelCase is the practice of writing compound words or phrases in which the words are joined without spaces and are capitalized within the compound like BreakFast, myName etc. CamelCase is so named because each word in the identifier is put together without spaces, but with the first letter of each word captilised, looking like humps of a camel. There are two varieties in CamelCase- UpperCamelCase and lowerCamelCase. In java variables, references, method names are declared in lowerCamelCase.

int animalCount;//Variable declared using lowerCamelCase

public abstract int getAnimalCount();//Method defined using UpperCamelCase

UpperCamleCase is also called as Pascal Notation. The only difference between the LowerCamelCase and UpperCamelCase (Pascal Notation) is that the first letter of the compound word is capitalised in case of UpperCamelCase while it is not in case of lowerCamelCase. In Java class names are declared in UpperCamelCase notation.

class AnimalTest //Observe the UpperCamelCase notation used for declaring the class name
{

String name;
public AnimalTest(String name)
{

this.name=name;

}

}

Read more on Java Programming Style Guide here.

For more information on the CamelCase notation here.

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: