Key and operators. In this article tokens are invariably viewed as keywords and phrases and can’t be utilized for identifiers

Key and operators. In this article tokens are invariably viewed as keywords and phrases and can’t be utilized for identifiers

Much keywords

school reports a class

create begins a do/while trap (program with postcondition)

else identifies the department of an if appearance which can be completed once the problem is actually bogus

untrue specifies the ‘false’ property value the Boolean kind

determine the item being iterated in an about hook

can be used as an infix user to check that a worth belongs to a range, a series or some other enterprise that determine the ‘contains’ technique

is used in when construction for a similar mission

mark a sort quantity as contravariant

is used as an agent to evaluate that a price does NOT fit in with a range, a series and other thing that describes the ‘contains’ way

is employed in whenever construction for similar mission

screen declares an user interface

is utilized in once construction for the same intent

is utilized in any time expressions for a similar factor

nothing are a constant standing for an item referral that does not suggest any object

accurate specifies the ‘true’ importance of the Boolean type

typealias declares a sort alias

typeof restricted to future make use of

val reports a read-only land or local changeable

var reports a mutable belongings or local variable

once begins an once concept (performs among the granted offices)

while begins ages hook (circle with prerequisite)

Soft keyword phrases

Listed here tokens behave as key words into the situation after being appropriate and certainly will be utilized for identifiers some other contexts:

active mention a compelling enter Kotlin/JS signal

price with the classroom keyword declares an inline class

Modifier keyword

Below tokens work as search phrases in modifier details of declarations and will be used as identifiers some other contexts:

actual means a platform-specific setup in multiplatform tasks

abstract mark a course or manhood as conceptual

annotation reports an annotation lessons

friend reports a friend target

const markings a property as a compile-time consistent

enum declares an enumeration

expect markings a resolution as platform-specific, expecting an application in system components.

outside spots a statement as applied not just in Kotlin (obtainable through JNI or perhaps in JavaScript)

infix brings calling a features in infix writing

interior assists writing about the exterior school instance from a nested classroom

interior marks a resolution as obvious with the current economic section

out mark a type quantity as covariant

supersede markings enrolled as an override of a superclass manhood

open represents a declaration as apparent anywhere

reified scars a kind quantity of an inline work as available at runtime

enclosed declares an enclosed class (a course with restricted subclassing)

suspend spots a purpose or lambda as suspending (usable as a coroutine)

tailrec spots a work as tail-recursive (enabling the compiler to change recursion with iteration)

Specialized identifiers

Here identifiers tend to be outlined by your compiler in particular contexts and can also be used as regular identifiers various other contexts:

subject is used inside real estate accessor to mention towards assistance subject with the property

Workers and unique representations

Kotlin supporting this workers and particular representations:

&& , || , ! – logical ‘and’, ‘or’, ‘not’ workers (for bitwise operations, utilize matching infix functionality)

== , != – equivalence operators (render to messages of equals() for non-primitive types)

, > , , >= – assessment employees (equated to calls of compareTo() for non-primitive types)

[ , ] – listed connection user (render to contacts of take along with )

?. does a safe telephone call (phone calls one way or accesses a residential property in the event that individual is non-null)

?: brings the right-hand worth when the left-hand importance is null (the elvis owner)

: split a reputation from a kind in conditions

? signifies a type as nullable

classify the boundaries and the entire body of a lambda manifestation

split the variables and repay sort testimony in a features form

sets apart the problem and body of a when concept branch

highlights or mention a cycle label

highlights or references a lambda name

; stands between numerous reports for a passing fancy range

$ mention a changeable or term in a chain layout

replacements an empty vardeenhet in a lambda phrase

substitutes an abandoned vardeenhet in a destructuring resolution