What is difference between 'let' and 'var' declaration ?
Answer Posted / 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 |
Post New Answer View All Answers
Explain deinitializer in swift programming language?
Should I use struct or class swift?
What are the advantages of using swift for ios development?
Is swift faster than java?
What is the difference between closure and function in swift?
What is abstract class in swift?
What is reuseidentifier in swift?
What is a tuple in swift?
How long does a swift transfer take?
What is an attribute in swift?
How to write a multiple line comment in swift?
What is encapsulation in swift?
Why we use delegates in swift?
What are the most important features of swift?
What is a function in swift?