---
title: "Packages in java"  
description: "Packages A package is a group of related classes, interfaces, enumeration and annotation and provide access protection and namespace management. Som"  
author: "Anonymous User"  
published: 2018-09-07  
updated: 2018-09-07  
canonical: https://www.mindstick.com/blog/11962/packages-in-java  
category: "java"  
tags: ["java"]  
reading_time: 1 minute  

---

# Packages in java

## Packages

A package is a group of related classes, [interfaces](https://www.mindstick.com/articles/12100/interfaces-in-java-real-life-example), [enumeration](https://www.mindstick.com/blog/88/enumeration-in-c-sharp) and annotation and provide access [protection](https://www.mindstick.com/blog/301143/how-to-wear-knee-braces-for-the-best-protection) and [namespace](https://www.mindstick.com/articles/12552/namespace) management.

## Some of the existing packages are-

**Java.lang** -[collection](https://www.mindstick.com/articles/1718/collections-in-java) of fundamental classes

**Java.io** -classes for input, output [functions](https://www.mindstick.com/forum/160140/explain-the-role-of-functions-as-a-service-faas-in-serverless-computing) are collected in this group.

A programmer can define their own packages to bundle a group of classes/interfaces etc.

## Creating a package:

For the [creation](https://yourviews.mindstick.com/view/85506/what-was-the-causes-of-creation-of-pakistan) of the package, we should choose a name for the package and include a package statement along with that name at the top of every source file that contains classes, interfaces, enumeration and annotation types that you want to include in the package.

**Packaging [naming conventions](https://www.mindstick.com/forum/145555/what-are-some-common-naming-conventions-used-in-programming):**

Packages have [reverse order](https://www.mindstick.com/forum/156836/what-is-a-c-sharp-program-to-print-individual-from-a-string-in-reverse-order) [domain names](https://answers.mindstick.com/qa/97742/what-domain-names-does-netflix-have-in-use-on-the-network). e.g college.art.history.

\

---

Original Source: https://www.mindstick.com/blog/11962/packages-in-java

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
