Declaring Constants and Variables
In Swift language to store temporary data we have to use variables and contants.Here we use var keyword to declare variables and let keyword to declare Constants.
T declare a constant variable
You can declare multiple constants or multiple variables on a single line var x=0,y=6
To define a data type we can use Type Annotations.
var Message: String
Here var Message has a type String
We can change the value of a variable anytime but the value of constant can not be changes once it is set.
Printing Constants and Variables
print method is used to print the value of varable or constants.String interpolation is used to include placeholders
print("Welcome Amit you got a \(message)")
//This line is comment
Multiline comments start with a forward-slash followed by an asterisk (/*) and end with an asterisk followed by a forward-slash (*/):
/* here it is
Multiline comment */