L019 | Identifiers in Java | Class 9th | ICSE | Computer Applications | Java

What are Identifiers?

Why are Identifiers Important?

Rules for Naming Identifiers

To ensure that an identifier is valid in Java, it must adhere to the following rules:

  1. Must start with a letter (A-Z or a-z), an underscore (_), or a dollar sign ($).
  2. Can contain letters, digits (0-9), underscore (_), and dollar sign ($).
  3. Cannot be a Java keyword or reserved word.
  4. Case-sensitive: Java differentiates between uppercase and lowercase letters.
  5. No spaces are allowed.

Types of Identifiers

Identifiers in Java are used to name the following:

  1. Variables: To store data values.
  2. Methods: To define actions or functions.
  3. Classes: To define blueprints for objects.