Complete the function that takes a class as input and returns all of its public properties.
Computer scienceProgramming languagesKotlinObject-oriented programmingObject-oriented programming features
Reflection
List of properties
Report a typo
Write a program in Kotlin
import kotlin.reflect.KClass
import kotlin.reflect.full.memberProperties
data class User(val name: String, val age: Int, private val password: String)
fun getProperties(kClass: KClass<*>): Collection<String> {
return // make your code here
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.