July 2018
Intermediate to advanced
242 pages
8h 6m
English
Let's assume we have the following two classes predefined:
data class Song(val title: String)data class Artist(val name: String)
We are going to define a type alias for the map of Song type values and a generic key type–Map<T, List<Song>>. Next, we are going to use it to define a function that will return the most popular Artist instance for a given Map<Artist, List<Song>> object.
Read now
Unlock full access