Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I own a domain, and I whenever I've dealt with Java-style package naming, I've gone with Once I encountered package that did the following:

Is one of these right, or is it something that's up to the developer's discretion? Is there some sort of convention that deals with this?

share|improve this question
up vote 3 down vote accepted

There's no real rule here, just the conventions that Sun created with the com.sun.* packagers. The only real requirement is uniqueness and that the convention defines a folder/file structure.

What will be the decider in your case is what name you want for a 'root' folder - 'uk' or 'co'?

share|improve this answer
Thanks, that sounds fair enough. Though having packages with both* and* in the same project does seem very.. messy. – Andrey Dec 16 '12 at 10:04
Right - whatever you choose, be consistent. (Not being consistent with package naming can cause real headaches, like java files split into different roots, issues with testing protected methods, etc,) – Chad Thompson Dec 17 '12 at 4:02
I meant specifically when you have to use a third-party package and it uses* while you're using*. In which case I guess it's purely cosmetic. – Andrey Dec 17 '12 at 6:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.