Skip to content

Instantly share code, notes, and snippets.

@joansanfeliu
Created February 13, 2020 09:44
Show Gist options
  • Save joansanfeliu/3953fa3727bf8476232c72a6b382ac72 to your computer and use it in GitHub Desktop.
Save joansanfeliu/3953fa3727bf8476232c72a6b382ac72 to your computer and use it in GitHub Desktop.
Kotlin List with multiple types
fun main() {
val list: MutableList<Comparable<*>> = ArrayList()
list.add("Hello")
list.add(1)
println(list.toString())
// prints [Hello, 1]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment