0% found this document useful (0 votes)
20 views1 page

Identifiers

Identifiers are names given by programmers to various elements like classes and methods, following specific rules regarding acceptable characters and naming conventions. Class names should start with a capital letter, while method names should be in lowercase or camel case depending on the number of words. Variable names also follow a similar convention, emphasizing the use of lowercase for single words and camel case for multiple words.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views1 page

Identifiers

Identifiers are names given by programmers to various elements like classes and methods, following specific rules regarding acceptable characters and naming conventions. Class names should start with a capital letter, while method names should be in lowercase or camel case depending on the number of words. Variable names also follow a similar convention, emphasizing the use of lowercase for single words and camel case for multiple words.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

IDENTIFIERS

Identifiers are the names given by a programmer to a class name, method name, variable

name, and any other member of a class.

Rule for Identifiers

*for identifiers, acceptable characters are A-Z, a-z, 0-9 digits, and special characters only $ and _

*An identifier must not start with the number.

*Space is not allowed for identifiers

*A keyword must not be used as an identifier

Convention for a class name

*if a class name has only one word, then it should be written as the first letter capitalized

and the rest of the letter in lowercase

➔ Program, Demo, Number

*if a class name has multiple words, then the first letter of each word should be capital

➔ ProgramForDataTypes, JavaDemo, NumberProgram

Convention for a method name

*if a method name has one word, then it should be written in lowercase with ().

➔ run(), demo(), number()

*if the method name has multiple words, then the first word should be written in small

letters and from the second word, the first letter of each word should be capitalized with ().

➔ ProgramForDataTypes(), javaDemo(), numberProgram()

Convention for a variable

*if a variable name has one word, then it should be written in small letters.

➔ age, name, id, marks

*if the method name has multiple words, then the first word should be written in small

letters and from the second word, the first letter of each word should be capitalized.

➔ ageOfStudent, nameOfEmployee

You might also like