What difference between
import java.util.ArrayList;
import java.util.List; //1
import java.util.*; //2
Will I import all classes from java.util
in case 2 or only necessary? Is additional bytes will be added to class file in this case?
What difference between
import java.util.ArrayList;
import java.util.List; //1
import java.util.*; //2
Will I import all classes from java.util
in case 2 or only necessary? Is additional bytes will be added to class file in this case?
import java.util.*
will import all classes, but only the ones you actually use will be in the compiled code. It does not affect your program once it is compiled.
It only makes the compilation a little bit longer (probably talking milliseconds here), but nothing we can see, so just use whichever way you prefer/ is clearer.