kotlin keywords Flashcards
1
Q
as
A
- is used for type casts.
- specifies an alias for an import.
2
Q
as?
A
is used for safe type casts.
3
Q
break
A
terminates the execution of a loop.
4
Q
class
A
declares a class.
5
Q
continue
A
proceeds to the next step of the nearest enclosing loop.
6
Q
do
A
begins a do/while loop (loop with postcondition).
7
Q
else
A
defines the branch of an ‘if expression’ which is executed when the condition is false.
8
Q
false
A
specifies the ‘false value’ of the Boolean type.
9
Q
for
A
begins a “for loop”.
10
Q
fun
A
declares a function.
11
Q
if
A
begins an “if expression”.
12
Q
in
A
- specifies the object being iterated in a ‘for loop’.
- is used as an infix operator to check that a value belongs to ‘a range’, a collection or another entity that defines the ‘contains method.’
- is used in ‘when expressions’ for the same purpose.
- marks a type parameter as ‘contravariant’.
13
Q
!in
A
- is used as an operator to check that a value does NOT belong to ‘a range’ , a collection or another entity that ‘defines the ‘contains method’.
is used in ‘when expressions’ for the same purpose.
14
Q
interface
A
declares an ‘interface’ .
15
Q
is
A
- checks that ‘a value does NOT have a certain type’ .
- is used in ‘when expressions’ for the same purpose.