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 some design patterns which we normally use during the app development.
What are type methods in swift?
How proficient are you in objective-c and swift? Can you briefly describe their differences?
What is tuple? How to create a tuple in swift?
What is static in swift?
Explain the adapter and memento pattern?
What is the meaning of question mark "?" In swift?
What is difference between weak and strong in swift?
What is an optional in swift?
What is an attribute in swift?
Explain functions?
What is the difference between swift and objective c?
Are arrays structs in swift?
Is swift compiled or interpreted?
Explain what is half-open range operator?