File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

"_" in package name?

 
Ravi Nal
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in our requirement we need to use underscore "_" character in our package name.
does anyone foresee any problems in using "_" in package name.
Thank.
 
karl koch
Ranch Hand
Posts: 388
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
it should compile...but it is just not common.
if you can live with that, then go ahead.
k
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Ravi Nal
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by karl koch:
hi
it should compile...but it is just not common.
if you can live with that, then go ahead.
k


Dear k,
Thanks for ur reply.
i terribly pissedoff with "_" in my package name, but my management wants it.....so 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
Sheriff
Posts: 7023
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic