In order to better organize classes, Java provides a package mechanism. Packages are containers of classes that separate class namespaces. If no package name is specified, all examples belong to a default unnamed package. Packages in Java generally contain related classes. For example, all classes related to transportation can be placed in a package named Transportation.
Programmers can use package to indicate which specific package the class in the source file belongs to. The format of the package statement is:
package pkg1[.pkg2[.pkg3…]];
Five commonly used packages in Java:
java.lang.*
Provides programming using Java The basic classes for programming in the language. The most important classes are Object (which is the root of the class hierarchy) and Class (instances of which represent classes in a running application).
java.util.*
Contains the collection framework, legacy collection classes, event model, date and time facilities, internationalization and various utility classes (string tokenizer, random Number generator and bit array, Date class, Stack class, Vector class, etc.). Various common toolkits such as collection classes, time processing modes, date and time tools, etc.
java.io.*
Java's core library java.io provides a comprehensive IO interface. Including: file reading and writing, standard device output, etc. IO in Java is based on streams for input and output. All data is serialized and written to the output stream, or read from the input stream.
java.net.*
Not all systems support the IPv6 protocol and it can also be disabled using a system property while the Java networking stack attempts to detect it and use it transparently when available it. When IPv6 is unavailable or explicitly disabled, Inet6Address is no longer a valid parameter for most network connection operations. Although methods like java.net.InetAddress.getByName are guaranteed not to return an Inet6Address when looking up a hostname, it is still possible to create such an object by passing a literal value. In this case, most methods will throw an exception when called with Inet6Address.
java.sql.*
Provides an API for using the JavaTM programming language to access and manipulate data stored in a data source (usually a relational database). This API includes a framework that enables you to dynamically install different drivers to access different data sources.
PHP Chinese website has a large number of free JAVA introductory tutorials, everyone is welcome to learn!
The above is the detailed content of What's in the java package. For more information, please follow other related articles on the PHP Chinese website!

本篇文章给大家带来了关于java的相关知识,其中主要介绍了关于结构化数据处理开源库SPL的相关问题,下面就一起来看一下java下理想的结构化数据处理类库,希望对大家有帮助。

本篇文章给大家带来了关于java的相关知识,其中主要介绍了关于PriorityQueue优先级队列的相关知识,Java集合框架中提供了PriorityQueue和PriorityBlockingQueue两种类型的优先级队列,PriorityQueue是线程不安全的,PriorityBlockingQueue是线程安全的,下面一起来看一下,希望对大家有帮助。

本篇文章给大家带来了关于java的相关知识,其中主要介绍了关于java锁的相关问题,包括了独占锁、悲观锁、乐观锁、共享锁等等内容,下面一起来看一下,希望对大家有帮助。

本篇文章给大家带来了关于java的相关知识,其中主要介绍了关于多线程的相关问题,包括了线程安装、线程加锁与线程不安全的原因、线程安全的标准类等等内容,希望对大家有帮助。

本篇文章给大家带来了关于java的相关知识,其中主要介绍了关于枚举的相关问题,包括了枚举的基本操作、集合类对枚举的支持等等内容,下面一起来看一下,希望对大家有帮助。

本篇文章给大家带来了关于Java的相关知识,其中主要介绍了关于关键字中this和super的相关问题,以及他们的一些区别,下面一起来看一下,希望对大家有帮助。

封装是一种信息隐藏技术,是指一种将抽象性函式接口的实现细节部分包装、隐藏起来的方法;封装可以被认为是一个保护屏障,防止指定类的代码和数据被外部类定义的代码随机访问。封装可以通过关键字private,protected和public实现。

本篇文章给大家带来了关于java的相关知识,其中主要介绍了关于平衡二叉树(AVL树)的相关知识,AVL树本质上是带了平衡功能的二叉查找树,下面一起来看一下,希望对大家有帮助。


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Notepad++7.3.1
Easy-to-use and free code editor

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver CS6
Visual web development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment
