Key words and workers. In this article tokens are normally interpreted as keywords and phrases and should not be used as identifiers

Intense key

school declares a class

perform begins a do/while loop (program with postcondition)

otherwise describes the division of an if expression that’s performed whenever issue is actually incorrect

false specifies the ‘false’ property value the Boolean means

determine the thing are iterated in an at trap

is employed as an infix operator to evaluate that an appreciate is associated with an assortment, a variety or other business that determine the ‘contains’ approach

is employed in when expressions for the very same purpose

spots a kind parameter as contravariant

is utilized as an owner to determine that a value cannot belong to a variety, a variety or another enterprise that determine the ‘contains’ system

is utilized in any time construction for the same goal

screen declares a program

is used in as soon as expressions for a similar mission

is utilized in if construction for similar mission

nothing is a continual representing an item referral that does not denote any object

genuine determine the ‘true’ value of the Boolean form

typealias reports a type alias

typeof restricted to long-term usage

val reports a read-only house or local varying

var declares a mutable belongings or hometown adjustable

as soon as starts an as soon as phrase (executes a offered branches)

while begins a long time hook (program with precondition)

Smooth keyword combinations

The subsequent tokens behave as keyword phrases from inside the framework while they are appropriate and that can be used as identifiers some other contexts:

powerful mention a powerful type in Kotlin/JS signal

worth with all the type research declares an inline lessons

Modifier search phrases

These tokens behave as combination of keywords in modifier databases of declarations and certainly will be utilized for identifiers some other contexts:

real denotes a platform-specific setup in multiplatform plans

theoretical markings a category or user as abstract

annotation declares an annotation school

spouse declares a partner subject

const markings a property as a compile-time consistent

enum reports an enumeration

anticipate spots an announcement as platform-specific, planning on a setup in platform modules.

external spots an announcement as put in place maybe not in Kotlin (accessible through JNI or in JavaScript)

infix makes it possible for calling a feature in infix notation

interior helps referring to the outer lessons example from a nested type

inner marks a declaration as obvious in the current section

out mark a sort vardeenhet as covariant

supersede marks an affiliate as a supersede of a superclass representative

consumer spots an announcement as noticeable anywhere

reified spots a sort factor of an inline function as easily accessible at runtime

secured reports an enclosed course (a category with restricted subclassing)

suspend scars a work or lambda as suspending (usable as a coroutine)

tailrec spots a work as tail-recursive (letting the compiler to displace recursion with version)

Unique identifiers

All of the following identifiers are generally explained by your compiler in particular contexts and can also be utilized for consistent identifiers in other contexts:

niche is utilized inside a home accessor to refer towards supporting field associated with residence

Workers and specialized symbols

Kotlin helps in this article providers and particular representations:

&& , || , ! – rational ‘and’, ‘or’, ‘not’ employees (for bitwise businesses, incorporate matching infix services)

== , != – equivalence providers (render to calls of equals() for non-primitive varieties)

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

[ , ] – indexed accessibility driver (translated to phone calls of use and place )

?. executes a secure telephone call (phone calls one way or accesses real estate if your recipient is definitely non-null)

?: usually takes the right-hand benefits when left-hand advantages was null (the elvis agent)

: split a reputation from a kind in conditions

? marks a sort as nullable

classify the boundaries and the body of a lambda appearance

classify the parameters and generate type resolution in a function form

sets apart the problem and body of an as soon as term branch

highlights or sources a program label

introduces or records a lambda label

; stands between several assertions on a single series

$ references an adjustable or expression in a line format

substitutes an unused quantity in a lambda phrase

replacements an empty quantity in a destructuring statement

Submit a Comment

Your email address will not be published. Required fields are marked *

8 − = two

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>