kotlin keywords Flashcards

1
Q

as

A
  • is used for type casts.

- specifies an alias for an import.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

as?

A

is used for safe type casts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

break

A

terminates the execution of a loop.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

class

A

declares a class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

continue

A

proceeds to the next step of the nearest enclosing loop.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

do

A

begins a do/while loop (loop with postcondition).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

else

A

defines the branch of an ‘if expression’ which is executed when the condition is false.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

false

A

specifies the ‘false value’ of the Boolean type.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

for

A

begins a “for loop”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

fun

A

declares a function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

if

A

begins an “if expression”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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’.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

interface

A

declares an ‘interface’ .

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

is

A
  • checks that ‘a value does NOT have a certain type’ .

- is used in ‘when expressions’ for the same purpose.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

null

A

is a constant representing an object reference that does not point to any object.

17
Q

object

A

declares ‘a class and its instance at the same time.

18
Q

package

A

specifies the ‘package for the current file’ .

19
Q

return

A

‘returns from the nearest enclosing function or anonymous function’ .

20
Q

super

A
  • ‘refers to the superclass implementation of a method or property’ .
  • ‘calls the superclass constructor from a secondary constructor’ .
21
Q

this

A
  • refers to the ‘current receiver’ .

- ‘calls another constructor of the same class from a secondary constructor’ .

22
Q

throw

A

‘throws an exception’ .

23
Q

true

A

specifies the ‘true’ value of the ‘Boolean Type’ .

24
Q

try

A

‘begins an exception handling block’ .

25
Q

typealias

A

declares ‘a type alias’ .

26
Q

typeof

A

reserved for future use.

27
Q

val

A

declares a read-only ‘property’ or ‘local variable’ .

28
Q

var

A

declares a mutable ‘property’ or ‘local variable’ .

29
Q

when

A

begins a ‘when expression’ (executes on of the given branches).

30
Q

while

A

begins a ‘while loop’ (loop with precondition).