Lists, Sets, Maps or Iterables

Lists, Sets, Maps or Iterables

Iterable : Set & List

  • Both List and Set are Iterable, so they have the same methods and properties as the Iterable class.

  • A Map uses a different data structure internally, depending on its implementation. For example, HashMap uses a hash table in which the elements (also called values) are obtained using a key.

Example

Iterable<int> iterable = [1, 2, 3];

Map:

  • A Map uses a different data structure internally, depending on its implementation.

  • For example, HashMap uses a hash table in which the elements (also called values) are obtained using a key.