For example in Java, all the common classes like String, System etc which we have used are in a package called java.lang.
There are many such packages in Java, for example:
If we want to use a Date class which is in java.util package in our class, we need to inform Java compiler that we are interested in using the Date class of java.util package
```
import java.util.*;
public class Example1 {
public static void main(String[] args) {
Date currentDate = new Date();
System.out.println(currentDate);
}
}
```
```
import java.util.Date;
public class Example2 {
public static void main(String[] args) {
Date currentDate = new Date();
System.out.println(currentDate);
}
}
```
```
public class Example3 {
public static void main(String[] args) {
java.util.Date currentDate = new java.util.Date();
System.out.println(currentDate);
}
}-
```