+ 1
Static import for java.util
Why the following code is not working in which I want to static import java.util? https://code.sololearn.com/crjfuDdwGU4P/?ref=app
2 Réponses
+ 1
We can "import static"
It is a concept in java.
+ 1
static import is used so that we can use static member of a class without class name.
There is no static member named next in Scanner class. nextInt() is an instance method. So you have to create object before using it. You can't use static import in this context.