Home > Mobile >  Kotlin code why can directly call "Kotlin. The collections of the" Top function
Kotlin code why can directly call "Kotlin. The collections of the" Top function

Time:10-14

Each great spirit:

Kotlin can do it without any import with "Kotlin. Collections" Top level of the function, is this why?
Why can directly call the following listOf:

The data class Person1 (val name: String, val age: Int)

The class DataClassExecutor {
. .
Fun test (arg: String? : String? {
Val persons=listOf (Person1 (" Lucy ", the age=26), Person1 (" Lily ", the age=29))
. .
}
}
  • Related