Can we use "@" symbol as identifier?
class Identifier1
{
public static void main(String alt[])
{
int total@number=10;
System.out.println(total@number);
}
}
/*
O/P:- Compilation Error
Explanation :- The only allowed characters in Java Identifier are
A-Z, a-z, 0-9, _(underscore) and $(dollar)
*/
{
public static void main(String alt[])
{
int total@number=10;
System.out.println(total@number);
}
}
/*
O/P:- Compilation Error
Explanation :- The only allowed characters in Java Identifier are
A-Z, a-z, 0-9, _(underscore) and $(dollar)
*/
0 comments: