What is Identifier?

Identifier is nothing but a name. In java language variable name is acting as a identifier. In java any name can be represented as a identifier, that name can be used to identifiy the particular things.

Example of Identifier:

	variables name, mathod name, class name, array name
	interface name etc.

How do you write Identifier in Java?

Every programming language have thier own identifier rules. Java language also follow some rules.

Rules for identifier in Java:

Example of Valid Identifier:

	int a; int abc; int _xyz; int btn123; int dfg_123; int $xyz; int x$yz;
    	int numberseries; int large_number_series;

Example of Invalid Identifier:

	int 123; int 12abc; int xyz@; int num-value; int book name;

Example of case senstive Identifier:

    int num = 10;
    int Num = 20;
    int NUM = 30;

In above example you will see different-different variables and all variables have same name. They are different in just case senstive way. So the output will be different.


	//output of the above example..
Advertisement here

Share this Page.