What are identifiers? – java

Identifiers are any variable name, class names, method names.

Java is a case sensitive language so an identifier is not same in the lowercase and uppercase even both are spelled same.

So student is different from STUDENT.

Identifiers must not begin with a number or underscore.

e.g:      num, Ptr2

Some rules for the identifier:

  1. It should consists of (A-Z),(a-z),(0-9) or underscore(_).
  2. Identifiers can start with any alphabet or an underscore.
  3. Identifiers cannot consist of blank space and any special character.

Leave a Reply

Your email address will not be published. Required fields are marked *