Paul Clapham wrote:It's Unicode which defines what characters are letters and what characters are currency symbols, not Java. Java just follows Unicode's lead there. Here's a random page from my web search with a list of currency symbols:
Unicode Characters in the 'Symbol, Currency' Category
which I'm sure you haven't even heard of many of them.
Campbell Ritchie wrote:Welcome to the Ranch
Actually, that isn't accurate. A legal identifier must be different from any reserved words or restricted identifiers. Identifiers may contain letters, numbers (except at their beginning), _s, and currency symbols. Any currency, including pound, rupee, and euro, is permissible, but their use is discouraged as a style matter. Those rules are correct; they give a complete list of all the characters permissible, once you factor in all currencies. It might make the rules clearer if you add the word “only”.
Neither @ nor & is a letter; they are both abbreviations for whole words.
it is a letter
it is a currency symbol (such as '$')
it is a connecting punctuation character (such as '_')
it is a digit
it is a numeric letter (such as a Roman numeral character)
it is a combining mark
it is a non-spacing mark
isLetter(codePoint) returns true
getType(codePoint) returns LETTER_NUMBER
the referenced character is a currency symbol (such as '$')
the referenced character is a connecting punctuation character (such as '_')