Variables Flashcards
1
Q
How to declare a null-able variable? Is “var {var_ref_name}?;” valid declaration?
A
var {var_ref_name}: type?;
the type must be specifed if the variable will be null-albe.
2
Q
How to declare and initilize variable at in a single line?
A
for mutable variables:
var {var_ref_name} = value
for immutable variables:
val {var_ref_name}: type = value
or
val {var_ref_name} = value
3
Q
A
4
Q
A
5
Q
A
6
Q
A
7
Q
A
8
Q
A
9
Q
A
10
Q
A
11
Q
A
12
Q
A
13
Q
A
14
Q
A
15
Q
A