In Java, we must import java.util.List package in order to use List.
Here, we have created objects list1 and list2 of classes ArrayList and LinkedList. These objects can use the functionalities of the List interface.