Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do package names often begin with "com" [duplicate]

Tags:

java

package

Possible Duplicate:
Java packages com and org

I am a java developer. Nowadays I am learning struts and when reading a tutorial a curiosity intruded in my mind regarding

package com.something.something; 

I know it is a very simple package declaration but what about

package **com**.something.something; 

This package name fragment often comes in many commercial distributions. Now I want to know what does it mean? Please clarify it.

Thanks and sorry if I couldn't clarify it...

like image 759
Nishant Kumar Avatar asked Sep 14 '11 05:09

Nishant Kumar


People also ask

What does Com stand for in Java package?

prefix in package names means the same as .com suffix in domain names: "commercial".

Why are package names reversed?

Reverse domain name notation (or reverse-DNS) is a naming convention for components, packages, types or file names used by a programming language, system or framework. Reverse-DNS strings are based on registered domain names, with the order of the components reversed for grouping purposes.

What is Java package name?

A java package is a group of similar types of classes, interfaces and sub-packages. Package in java can be categorized in two form, built-in package and user-defined package. There are many built-in packages such as java, lang, awt, javax, swing, net, io, util, sql etc.

Are underscores allowed in Java package names?

Package names are all lowercase, with consecutive words simply concatenated together (no underscores). For example, com.


1 Answers

It's just a namespace definition to avoid collision of class names. The com.domain.package.Class is an established Java convention wherein the namespace is qualified with the company domain in reverse.

like image 98
Sahil Muthoo Avatar answered Sep 24 '22 00:09

Sahil Muthoo