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
What is the benefit of using guard statement in swift?
What are the advantages of using swift for ios development?
How many access levels are present in swift?
Are arrays structs in swift?
What is floating point number in swift?
What is nsrange in swift?
Explain me what is swift?
How long does a swift transfer take?
What is unowned in swift?
What is mvp in swift?
Mention what is the difference between Swift and ‘Objective-C’ language?
Is swift a functional language?
Is swift difficult to learn?
How can you write a multiple line comment swift?
What is difference between any and anyobject in swift?