aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes identifier - currency symbols Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "identifier - currency symbols" Watch "identifier - currency symbols" New topic
Author

identifier - currency symbols

Moya Green
Ranch Hand

Joined: Jan 24, 2002
Posts: 49
Are currency symbols treated as valid identifiers? I know identifier beginning with $ is valid. How about others, say foreign currency symbols?
Thanks a lot!
Moya
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
You may find your answer in JLS 3.8 Identifiers

The Java letters include uppercase and lowercase ASCII Latin letters A-Z (\u0041-\u005a), and a-z (\u0061-\u007a), and, for historical reasons, the ASCII underscore (_, or \u005f) and dollar sign ($, or \u0024). The $ character should be used only in mechanically generated source code or, rarely, to access preexisting names on legacy systems.

[ August 19, 2002: Message edited by: Valentin Crettaz ]

SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
It says that the Java letters include those letters, but not that they are the only Java letters.


Ron Newman - SCJP 1.2 (100%, 7 August 2002)
Dan Chisholm
Ranch Hand

Joined: Jul 02, 2002
Posts: 1865
Check out the isJavaIdentifierStart and isJavaIdentiferPart method of
java.lang.Character.


Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="http://www.danchisholm.net/" target="_blank" rel="nofollow">Try my mock exam.</a>
Moya Green
Ranch Hand

Joined: Jan 24, 2002
Posts: 49
Thank you very much for all your help.
So the followings are valid identifiers:
€123, �java, �exam
Please correct me :roll: .
Moya
Anthony Villanueva
Ranch Hand

Joined: Mar 22, 2002
Posts: 1055
Originally posted by Moya Green:
So the followings are valid identifiers:
€123, �java, �exam

Yes
Moya Green
Ranch Hand

Joined: Jan 24, 2002
Posts: 49
Thank you very much, Anthony! I got it.
Moya
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: identifier - currency symbols
 
Similar Threads
Query
valid Identifier
illegal identifier
complete list of connecting characters?
why $ only ???