What is Java Identifiers ?

A name in java program is called identifier. It could be class name, method name, variable name , e.t.c.

Rules to define java identifiers:

  1. a-z,A-Z,0-9,_, $ are the only allowed characters in java identifiers. If we are using any other character we will get compile time error.
  2. Identifiers are not allowed to starts with digit.
  3. Java identifiers are case sensitive.
  4. There is no length limit for java identifiers but it is not recommended to take more than 15 lengths.
  5. We can’t use reserved words as identifiers.
  6. All predefined java class names and interface names we use as identifiers.

Leave a Reply

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