Intermediate Kotlin
Q60 / 100

What does the contract block in Kotlin allow?

Correct! Well done.

Incorrect.

The correct answer is B) Providing the compiler hints about runtime behavior to improve smart casts and null analysis

B

Correct Answer

Providing the compiler hints about runtime behavior to improve smart casts and null analysis

Explanation

Contracts (kotlin.contracts) let functions declare guarantees (e.g., "if this returns true, parameter x is not null") so the compiler can perform better smart casts.

Progress
60/100