Link to home
Start Free TrialLog in
Avatar of bachstein
bachstein

asked on

why is int e# an incorrect variable name?

Why is int e# an incorrect variable name? if in the end is a letter followed by a character that well could be a connector character, i mean ,  is not a plus or a minus.
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

You can test any non-start character with
System.out.println(Character.isJavaIdentifierPart('#'));

Open in new window

Avatar of bachstein
bachstein

ASKER

Thanks CEHJ, but in  a certification test scenario , my guess would have been, yes it is valid. It turns out is not,  why?. I just have to learn it the way it is?
iirc only numbers, letters and underscores. The first of these can't start an identifier
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial