1

What is the purpose of naming package starting from com. ? There is many tutorials where this is practiced, so it's good to know why.

I got project named house. in source directory there are package's named doors and walls, they should be named com.house.doors and com.house.walls? whats advantage it brings?

greg-449
  • 109,219
  • 232
  • 102
  • 145
Periit
  • 65
  • 10
  • 1
    May be this link helps!! http://stackoverflow.com/questions/3226282/are-there-best-practices-for-java-package-organisation – Rajendra Gupta Apr 27 '15 at 11:51

1 Answers1

1

You are supposed to use names that correspond to a web page that you own. The purpose is to avoid name clashes.

If you add a third party library, it is nice to know that the fully specified names won't be the same as the ones you are using.

If your (or your company's) web page is located in another top domain, then the packages should also start with that same something else.

See the java naming conventions.

Klas Lindbäck
  • 33,105
  • 5
  • 57
  • 82