import java.*;
Why cannot I do this import? Instead of importing all classes in a particular sub-package of the package 'java', I tried to import all the sub-packages under the the 'java' package.
How can I import all the built-in classes?
There is no such thing as sub-package in java.
java.util.stream
is not a sub-pacakge of java.util
.
Therefore import java.util.*
doesn't import the classes of java.util.stream
.
To import all the built in classes, you have to import them one package at a time. It's a better practice, though, to only import the classes that you actually need.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With