Programmer's Wiki
Advertisement
16px-Pencil

Namespaces are used to classify classes and other namespaces that perform a similar function. They can be used for example to disambiguate between classes that may have same names but different functions.

For instance, a class named "Font" could be present in libraries for printing, displaying fonts on a monitor, etc. A Point may have different implementations depending on the context; one may be for graphing and another might be for window positioning.

Namespaces are also commonly used in XML documents. In Java, packages are used to perform the same function.

Advertisement