Can we use Reserved literals as identifier?
class Identifier6
{
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 53 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 53 reserved words in Java.
*/
0 comments: