# What Is a package?

包是把一系列相关联的类和接口组织在一起的命名空间（`namespace`）。概念上你可以把包看作是电脑中不同的文件夹。你会把HTML文件放到一个文件夹中，图片放到另一个，脚本和应用程序放到另一个。由于使Java语言写的程序可能由成百上千个独立的类文件组成，所以将相关联的类和接口通过包的形式组织起来也是说的通的。

Java平台提供了一个巨大的类库，可以用在你自己编写的应用程序中。这些库被称为`Application Programming Interface`或者简称`API`。这些`API`通常被使用在一般的编程中。比如，`String`对象包含了字符串的状态和行为；`File`对象使得编程人员方便的创建，删除，检查，比较以及修改文件系统中的文件；`Socket`对象用来创建和使用网络套接字；许多`GUI`对象控制着按钮和选择框以及各种与用户图形节目相关的内容。`API`中包含成千上万可供使用的类。这样使得编程人员专注于自己的应用开发，而不是运行应用所需的基础建设。

[Java Platform API Specification](https://docs.oracle.com/javase/8/docs/api/index.html)包含了Java SE平台所有的包，接口，类，域，函数。这个网址将会是你非常重要的参考文档，打开并收藏吧

> 这里推荐一款应用`Dash`包含各种API文档


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://eric3wade.gitbook.io/java/learning-the-java-language/oop-concepts/what-is-a-package.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
