Swift - Optionals
Consider this Swift code:
var number: Int! = nil number = 42 print(number + 8)What is the output?
var number: Int! = nil number = 42 print(number + 8)What is the output?
number is initially nil but then assigned 42 before use.number is 42, adding 8 results in 50, which prints without error.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions