List of properties

Report a typo

Complete the function that takes a class as input and returns all of its public properties.

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
}
___

Create a free account to access the full topic