We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

why is int e# an incorrect variable name?

bachstein
bachstein asked
on
Medium Priority
831 Views
Last Modified: 2012-05-11
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.
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2016

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

Open in new window

Author

Commented:
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?
CERTIFIED EXPERT
Top Expert 2016

Commented:
iirc only numbers, letters and underscores. The first of these can't start an identifier
Java Developer
CERTIFIED EXPERT
Top Expert 2010
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.