Chapter 5

  1. Kotlin provides a collection of elements with a start and endpoint. This collection is called a range. A range is the quickest way to create a collection of sequences. 1..100 or 'a' to 'z' are ranges of the first 100 number or of alphabets.
  2. Lists that do not allow us to update their contents, and provide only read-only functionality, are called immutable lists. Lists that allow us to add new elements and update existing elements are called mutable lists. Kotlin provides a number of interfaces and methods that are dedicated for both mutable and immutable lists.
  3. An iterator is a special type of data structure that works with collection. The primary responsibility of an iterator is to iterate over the collection and produce the next object from the list if required.
  4. Iterable, collection, and list are the names of the interfaces, and all these interfaces belong to the immutable collection.
  5. Set is a special type of collection that does not support duplication and contains a list of unique values. Map is a data structure that holds collections of key-value pairs. Similar to set, map does not support duplicate values.
  6. Mutable iterators, mutable collections, and mutable lists are interfaces that belong to the mutable collection. These interfaces allow new items to be added to the list and existing items to be updated as well.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.17.137