Can we use Reserved words as identifiers?
class Identifier5
{
public static void main(String alt[])
{
int if=25;
System.out.println(if);
}
}
/*
O/P:- Compilation Error
Explanation :- We cannot use reserved words as an identifier.
There are total 50 reserved words in Java.
*/
{
public static void main(String alt[])
{
int if=25;
System.out.println(if);
}
}
/*
O/P:- Compilation Error
Explanation :- We cannot use reserved words as an identifier.
There are total 50 reserved words in Java.
*/
0 comments: