iOS Swift - Swift Language Essentials
Consider this Swift code snippet:
What will be printed and why?
var a = 8 let b = a a = 15 print(b)
What will be printed and why?
var a = 8 let b = a a = 15 print(b)
a is a variable initialized to 8, b is a constant assigned the current value of a.a is changed to 15, but b remains unchanged because it holds a copy of the original value.b outputs 8, the value it was assigned at declaration.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions