Pair Type in Kotlin
Level 268 keystrokes
Creates a Pair and reads its two components.
Kotlin code
// Pair holds exactly two values, which may have different types1val pair = Pair("name", 42)// first is the first value: name2println(pair.first)// second is the second value: 423println(pair.second)Output
name 42
Practice typing this code. Results are not recorded in the rankings.
Symbols in this code
The symbols you type in this Kotlin code and how often they appear.
(× 3)× 3.× 2"× 2,× 1=× 1