• Post Reply Bookmark Topic Watch Topic
  • New Topic

Legal Identifiers - Currency Character ($)  RSS feed

 
Milton Ochoa
Ranch Hand
Posts: 336
Firefox Browser Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to All,

a few days ago, i was reading a pages of tips to remenber about java, and I find that the currency Character are legals for Identifiers, yeah i know everyone here know that, but i was wondering �Wha are thes Currency Characters?

Today I compiled the next example:




... and its fine.

My question is: �What are all these currency Chracters?
 
Bill Shirley
Ranch Hand
Posts: 457
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The naming conventions implicitly suggests not using them:

http://java.sun.com/docs/books/jls/third_edition/html/names.html#6.8

The identifiers section explicitly suggests not using them:

"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."

http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.8
 
Milton Ochoa
Ranch Hand
Posts: 336
Firefox Browser Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Bill, you answer make me think in another question.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!