Legal Identifiers in Java

  • Identifiers must start with a letter, a currency character($), or an underscore(_).
  • Identifiers cannot start with a number.
  • After the first character, identifiers can contain any combination of letters, currency characters, underscores, or numbers.
  • Identifiers are case-sensitive
  • “enum” cannot be used as identifier because it is added as a Java keyword in 5.0

Leave a Reply

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

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.