import java.util.*;
// util is a subpackage created inside java package.
// import the Vector class from util package.
import java.util.vector;
// import all the classes from util package
import java.util.*;
// All the classes and interfaces of this package will be accessible but not subpackages.
import package.*;
// Only mentioned class of this package will be accessible.
import package.classname;
// Class name is generally used when two packages have the same class name.
// For example in below code both packages have date class.
// So we need to use a fully qualified name to avoid conflict
import java.util.Date;
import my.packag.Date;
// Note static keyword after import.
import static java.lang.System.*;
class StaticImportDemo {
public static void main(String args[]) {
// We don't need to use 'System.out' as imported using static.
out.println("GeeksforGeeks");
}
}
Output:
GeeksforGeeks