ICSE Class 10 Computer Applications Question 3 of 76

Revising Basic Java Concepts — Question 3

Back to all questions
3
Question

Question 3

What is an identifier ? What is the identifier forming rule(s) of Java?

Answer

Identifiers are the names given by the programmer to various program units of Java. Identifiers are the names of variables, methods, classes, packages and interfaces etc.

Identifier forming rules of Java state the following:

  1. Identifiers can have alphabets, digits, _ (underscore) and $\text{\textdollar} characters and can be of any length.
  2. They must not be a keyword or Boolean literal or null literal.
  3. They must not begin with a digit.
  4. Java is case sensitive i.e., upper-case letters and lower-case letters are treated differently.