Kotlin - Basics and JVM Runtime
Which of the following is a correct Kotlin syntax feature that improves safety compared to Java?
? after a type to mark it nullable, e.g., String?.var x: Int = null to allow null values is wrong because Int cannot be assigned null without ?. Declaring variables without specifying type always is incorrect because Kotlin requires type inference or explicit types. Using void as a return type is Java syntax, not Kotlin.val name: String? to declare a nullable variable -> Option C15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions