Home > Java > JavaBase > What does import java.util.* mean?

What does import java.util.* mean?

hzc
Release: 2020-07-04 15:52:16
Original
13964 people have browsed it

[import java.util.*;]Import the class interface in the java.util package. The function of import in Java is to import the class interface in the package to be used. Import is at the beginning of the java file. First explain which categories will be used, and then we can specify a class in the code using only the class name.

What does import java.util.* mean?

import java.util.*;Import the class interface in the java.util package.

The function of import in Java is to import the class interface in the package to be used. Import is at the beginning of the java file. First explain which categories will be used. Then we can specify a class in the code using only the class name, that is, only call it by its first name, not its last name. The role of the package is to sort and classify Java classes. Java classes with different business logic are placed in the same package. Such as physical packages and tool kits.

Java's utility class library java.util package. In this package, Java provides some practical methods and data structures. This chapter introduces the Java utility class library java.util package. In this package, Java provides some practical methods and data structures. For example, Java provides the Date (Data) class and Calendar (Calendar) class to generate and obtain dates and times, provides the Random Number (Random) class to generate various types of random numbers, and also provides Stack (Stack) and Vector (Vector). , bitset (Bitset) and hash table (Hashtable) and other classes to represent the corresponding data structure.

In high-level programming languages, if you want to use a certain class or interface, you must use import to import this class. For example, when writing a servlet in Java and using httpServlet, you must add it at the beginning of the file (package After) write, import javax.servlet.http.*; means importing all the files in the javax.servlet.http package.

Recommended tutorial: "java tutorial"

The above is the detailed content of What does import java.util.* mean?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template