Hard Keywords Flashcards
The following tokens are always interpreted as keywords and cannot be used as identifiers:
as - used for ______. _______ and specifies an ________ for an ________.
Used for type casts
Specifies an alias for an import
as? - is used for ______ ______ _________ .
is used for safe type casts
break - ____________ the execution of a loop
Terminates the execution of a loop
class - declares a __________.
declares a class
continue - proceeds to the ________ __________ ______.
Proceeds to the next step of the nearest enclosing loop
do - begins a _____ / ________ ________. (______ with a ________ condition)
Begins a do/while loop (loop with post condition)
else - defines the ________ of an _________ __________ which is executed when the ___________ is __________.
Defines the branch of an if expression which is executed when the condition is false
false - specifies the _______ value of the _________ type
specifies the ‘false’ value of the Boolean type
for - begins a ______ __________.
begins a for loop
fun - declares a ________.
declares a function
if - begins an ______ _________.
begins an if expression
4
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
!in
2
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
interface - declares an __________.
declares an interface
is -
________ that a ______ has a certain ______.
Is used in _____ _____ for the same purpose.
checks that a value has a certain type
is used in when expressions for the same purpose
!is - checks that a _______ does ______ have a certain _______.
Is used in ______ ________ for the same purpose.
checks that a value does NOT have a certain type
is used in when expressions for the same purpose
null - is a _________ representing an ______ __________ that doesn’t point to any ________.
is a constant representing an object reference that doesn’t point to any object
object - defines a _______ and it’s _________ at the same time.
declares a class and its instance at the same time
package - specifies the ________ for the ________ _______.
specifies the package for the current file
return - ________ from the nearest enclosing ________ or ___________ ________.
returns from the nearest enclosing function or anonymous function
super (2)
refers to the superclass implementation of a method or property
calls the superclass constructor from a secondary constructor
this (2)
refers to the current receiver
calls another constructor of the same class from a secondary constructor
throw
throws an exception
true
specifies the ‘true’ value of the Boolean type
try - begins an _________ ___________ block
begins an exception handling block
typealias - declares a _____ _______
declares a type alias
typeof - (________ for future use)
(reserved for future use)
val
declares a read-only property or local variable
var
declares a mutable property or local variable
when - begins a ______ _______ (executes one of the given _______)
begins a when expression (executes one of the given branches)
while - begins a _____ ______ (_______ with _________)
begins a while loop (loop with precondition)