Quiz: Kotlin’s Type System

Test your understanding of the concepts discussed in this chapter.

1

What is the inferred type of name in the following Kotlin code?

fun processPerson(person: Person?) {
    val name = person?.name ?: "unknown"
}
A)

Person

B)

String

C)

Person?

D)

String?

Question 1 of 50 attempted

Get hands-on with 1400+ tech skills courses.