This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes what is a connecting character? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "what is a connecting character?" Watch "what is a connecting character?" New topic
Author

what is a connecting character?

adam Lui
Ranch Hand

Joined: Sep 03, 2007
Posts: 186
damn, sorry for another stupid question


boolean b = true;<br />System.out.println ("I believe in Java.<br />Java will make my dream come " + b);
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18546
    
  40

Give us some context please. Where did you hear this term? And what was the exact phrasing?

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Kelvin Chenhao Lim
Ranch Hand

Joined: Oct 20, 2007
Posts: 513
This isn't a stupid question, Adam. I'm guessing you're talking about "connecting characters" that are allowed in Java identifiers. This is language-specific, so it'll vary from language to language (human language, not programming language!). But in English/Latin, the only such character is the underscore (_).

In general, a connecting character is one for which Character.getType() returns a value with the CONNECTOR_PUNCTUATION flag (bit 23) set.

Incidentally, the set of characters allowed within a Java identifier are those for which Character.isJavaIdentifierPart() returns true, while the characters allowed at the start of a Java identifier is the smaller subset for which Character.isJavaIdentifierStart() returns true.

I don't know of any examples of connecting characters from non-English languages, although maybe some other folks here can chime in.
[ November 05, 2007: Message edited by: Kelvin Lim ]

SCJP 5.0
Kelvin Chenhao Lim
Ranch Hand

Joined: Oct 20, 2007
Posts: 513
Ah, I figured it out from the API spec. The connecting characters are those that belong to the Unicode category 'Pc' (Punctuation, connector). Here's a complete list for the current version of the Unicode spec:

http://www.fileformat.info/info/unicode/category/Pc/list.htm
[ November 05, 2007: Message edited by: Kelvin Lim ]
adam Lui
Ranch Hand

Joined: Sep 03, 2007
Posts: 186
I am awed Kelvin, thank YOU (again)!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what is a connecting character?