This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark ""_" in  package name?" Watch ""_" in  package name?" New topic

"_" in package name?

Ravi Nal

Joined: Feb 18, 2003
Posts: 4
in our requirement we need to use underscore "_" character in our package name.
does anyone foresee any problems in using "_" in package name.
karl koch
Ranch Hand

Joined: May 25, 2001
Posts: 388
it should compile...but it is just not common.
if you can live with that, then go ahead.
Valentin Crettaz
Gold Digger

Joined: Aug 26, 2001
Posts: 7610
There shouldn't be any problem in using the underscore in a package name since the underscore is an acceptable Java letter as per JLS 3.8 Identifiers, that is uppercase (A-Z) and lowercase (a-z) letters, underscore (_), dollar sign ($) and digits (0-9).
Moreover, we ain't got many rules 'round these parts, but we do got one. Please change your displayed name to comply with the JavaRanch Naming Policy.
Thanks Pardner! Hope to see you 'round the Ranch!

[Blog] [Blogroll] [My Reviews] My Linked In
Ravi Nal

Joined: Feb 18, 2003
Posts: 4
Originally posted by karl koch:
it should compile...but it is just not common.
if you can live with that, then go ahead.

Dear k,
Thanks for ur reply.
i terribly pissedoff with "_" in my package name, but my management wants i'm looking for some good reasons so that i can survive without using "_" in my package name.
[ February 18, 2003: Message edited by: hiock ]
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
You could complain that your productivity suffers from contorting your hands to press that out-of-the way-and-difficult-to-find key (and with all of the subsequent backspacing required after pressing the '+' or the ')' right next to it). Plus, just imagine the injuries that your fingers might suffer from the strain.
You might be able to sabotage the convention by using two or even three sebsequent underscore characters in your package names (e.g., use package__name instead of package_name). Your co-workers will likely have a hard time trouble shooting the compiler errors.
[ February 19, 2003: Message edited by: Dirk Schreckmann ]

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
I agree. Here's the link:
subject: "_" in package name?
It's not a secret anymore!