In Java, the List
interface represents an abstract list of things. Any class the implements List
(for example, LinkedList
) must implement its methods and behave according to its contract.
You can essentially think of it as an array, but keep in mind that arrays are only one kind of list, and that implementations of List
do no have to use arrays internally.
The Set
also represents a collection of elements, but with no relationship or connection between them. Visually, you can think of a set as a sort of bag of things. You can add and remove things from the bag, but none of the items need to be related.
An Integer
, of course, is just an object wrapper around Java's int
primitive.
As such, a List<Set<Integer>>
object would be similar to a two-dimensional array, only without a defined order in the second dimension.
You would initialize a List<Set<Integer>>
as follows:
List<Set<Integer>> myList = new ArrayList<HashSet<Integer>>();
Where ArrayList
and HashSet
can be any classes that implement List
and Set
, respectively.