You may import either an individual class from a package or the entire package. : import « Java Source And Data Type « SCJP






To import an individual class


import java.util.List;
public class MainClass{
   private int iValue;
}



To import an entire package, simply add an asterisk (*) to the end of the package name.

import java.util.*;
public class MainClass{
   private int iValue;
}








1.4.import
1.4.1.You may import either an individual class from a package or the entire package.
1.4.2.White space and comments may appear before or after any of these elements.
1.4.3.To use classes with the same name in two different packages
1.4.4.Reference class without importing
1.4.5.Reference class with importing
1.4.6.Java compiler automatically imports all the classes in the java.lang package into every source file.