Suppose I have a Java class with only one dependency in java.util: that is, java.util.Scanner. And instead of writing import java.util.Scanner
I write (lazily) import java.util.*
.
Is the compiler smart enough to only import java.util.Scanner? Or does it actually import every class from java.util?
What exactly are the performance gains of writing import java.util.Scanner
in this case? That is, which of the following is true?
- It makes the code compile faster. -OR-
- It makes the code run more efficiently (e.g. uses less memory). -OR-
- There are no performance gains.