Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (9.5k points)
reopened by
Can anyone let me know what does java.util.* mean?

2 Answers

0 votes
by (19.7k points)

Java.util.* is a built-in package in Java which encapsulates a similar group of classes, sub-packages and interfaces. The * lets you import a class from existing packages and use it in the program as many times you need. 

You can find the list of all classes, interfaces, exceptions in the official document. 

However, you are using only a few classes from the java.util package like below import java.util.ArrayList;

import java.util.LinkedList;

   It’s better to specify them individually instead of importing the whole package as java.util.*

 

0 votes
ago by (1.8k points)
edited ago by

java.util.* is an import statement with the help of which we can import all the public classes as well as interfaces in the util package in one go and the major advantage is that we don’t have to import all the public classes and interfaces individually.

Syntax→ import java.util.*

Related questions

0 votes
1 answer
0 votes
1 answer
asked Jan 25, 2021 in Java by dante07 (13.1k points)
0 votes
1 answer
asked Jan 24, 2021 in Java by dante07 (13.1k points)
0 votes
1 answer
asked Jan 21, 2020 in Java by angadmishra (6.5k points)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...