+ 1
In java,when we should use import java.util.* and when use import java.util.Scanner?
5 Respuestas
+ 2
if u want to get input frm user then u can use scanner
if u want to use packages classes then u can import packages
even we can create packages on our own
+ 1
You should never import util.* unless you're sure you need all of them.
that will import every packages inside util which will make the project bloated.
It's always good to mention each package explicitly like
import java.util.scanner
+ 1
if u use * then u can use all classes on that package
if u want just scanner alone then u can write as
import Java.util.Scanner;
0
If you want to give message,
Actually it is very helpful suppose
You made any program and anyone else is
Using it, than import java. Until is very helpful
Because its give you message.
0
Just experience it and see its uses.