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
by (1.8k points)
edited 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
3 answers

1.2k questions

2.7k answers

501 comments

693 users

Browse Categories

...