问题
Possible Duplicate:
What package naming convention do you use for personal/hobby projects in Java?
I made a google sites site name sites.google.com/sites/abc.(abc is not real name)
Would mcl.abc.sites.com.google.sites be valid for a package name.
EDIT: Whoops com.google.sites.abc.mcl
回答1:
Valid? Yes. Conventional? Probably not.
Java conventions typically recommend package names to be a website address (like your company's) in reverse, e.g. com.google.foo.
More on naming conventions here.
回答2:
you can use any name, but if its valid its about the criteria that you use, i recommend the following criteria:
1) avoid to use country.company.util (i work in a project that the company change 3 times of name, so you can see in the same project names like: com.companyname1.util, cl.companyname2.util, com.companyname3.util) 2) you can use naming like: dev.utils or apiname.commons.utils or any other criteria
Well, i hope this clarify your doubts.
回答3:
Standard coding convention for packages in Java reverses the domain name.
Given your example,
sites.google.com/sites/abc
com.google.sites.abc.mcl
来源:https://stackoverflow.com/questions/12168968/is-this-a-valid-java-package-name