Kotlin - Null Safety
Which of the following is the correct syntax to safely call the
length property of a nullable String name?length property of a nullable String name??., used as object?.property or object?.function().. without safety, which can cause a crash if name is null. val len = name?.length correctly uses ?.. val len = name!!length uses !! incorrectly with property access. val len = name?length uses invalid syntax ?length.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions