What is difference between 'let' and 'var' declaration ?
Answer / iosraj
constants are expressed with the ‘let’ keyword. So once assigned value can not be change, but assigned values using 'var' keyword can be change.
In terms of objective -c or compare with objective -c, 'var' is Mutable and 'let' is NonMutable.
let kMyConstant = 40
Or
let kMyConstant: Int = 40
var myString = "This is my string."
| Is This Answer Correct ? | 0 Yes | 0 No |
What is init() in swift?
What is “defer”?
What are the type of integers does swift have?
What are the control transfer statements in swift?
What is forced unwrapping?
Does apple use swift internally?
What is encapsulation in swift?
How can you prioritize the usability of the demand process?
Is "swift" a good programming language? Explain
How can you write a comment in swift?
What is lazy stored procedure in swift and when is it used?
What are the different ways to pass data in swift?