❮ Previous Next ❯

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
❮ Previous Next ❯

Follow Us




  Tutorials

Popular Links

Contact Us

address Plot No-741,2ND Floor
Opp. Bhagabati Temple,Jayadev Vihar
      Bhubaneswar-751013
      Email: info@silantechnology.com
      Phone: 0674-2361252
address
39877, sundale dr, apt#101, Fremont, California 94538, USA
       Phone: +1(262)388-7619

facebook twitter google linked in

© 2018 Silan Technology. All Rights Reserved