Swift - Optionals
Identify the error in this Swift code snippet:
var age: Int? age = nil print(age!)
var age: Int? age = nil print(age!)
! on an optional tries to get its value directly.age is nil, force unwrapping causes a runtime crash.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions