Find destructuring declarations

Report a typo

You have the following data class:

data class Student(val name: String, val age: Int, val isStudent: Boolean)

Choose all the correct cases of destructuring declarations:

1) fun iterateThroughStudentsList(studentData: MutableList<Student>) {
    for ((name, _, isStudent) in studentData) {
        // some code
    }
}
2) fun iterateThroughStudentsList(studentData: MutableList<Student>) {
    for ((, age, isStudent) in studentData) {
        // some code
    }
}
3) fun iterateThroughStudentsList(studentData: MutableList<Student>) {
    for ((name, age, ) in studentData) {
        // some code
    }
}
4) fun iterateThroughStudentsList(studentData: MutableList<Student>) {
    for ((_, _, _) in studentData) {
        // some code
    }
}
Select one or more options from the list
___

Create a free account to access the full topic