I'm trying to learn Kotlin from Python and I need some help with how to create an array of different types using scanner class but keep getting an error java.lang.ArrayIndexOutOfBoundsException. Thanks in advance.
fun main(){
val scanner = Scanner(System.`in`)
println("Enter your name: ")
println("Enter your height in inches: ")
println("Enter your weight: ")
val (name, height, weight) = arrayOf(scanner)
println("your name is $name, your height is: $height your weight is $weight")
}
arrayOf(scanner)is just an array with your single scanner instance.