JAVA Identifiers and Reserved Words

Any name injava program is called as identifiers. It may be a variable name, a method name, a class etc.

EXAMPLE

Class Test
{
     public Static void main(String[] args)
     {
         int X=10;
     }
}


NOTE:ALL THE RED WORDS ARE IDENTIFIERS.
RULES & REGULATIONS FOR DECLARING AN IDENTIFIER:
1.The following allowed characters can be taken to declare as identifiers.
               A-Z
               a-z
               0-9
_ (underscore)

2. To declare an identifier the first character shouldnot be digit.
Exa:   1234sum   (invalid)
         $_$_$_      (valid)

3.Reserved words never consider as identifiers
Exa: int x=10;      (valid)
      Int if =10;   (invalid)

4.All inbuilt class & interfaces can be considered as identifier, but it is not recommended because the readability of the code reduce.
Exa.

int String=10;
System.out.println(String) ;  // 10
Here String is a valid identifier but not recomnded.
int Runnable=20;
System.out.println(Runnable);  //20


Here Runnable(an inbuilt interface) is a valid identifier, but not recommended.
5. There is no length limit of identifier.
Exa:  int xxxxxxxxxxxyyyyyxz=10;

Reserved Words

reserve_keywords

Our Services:

Java Training | Python Training | Machine Learning with Python Training | Deep Learning with Python Training | Projects

SILAN Technology
Call to: 9439202111  |  9658317757  |  0674-2361252

Comment