I've walked through https://kotlinlang.org/docs/reference but I could not find reserved keyword, used in Kotlin. How many keywords does Kotlin have? As long as we know Java has its own keyword list like here:
UPD: The keyword reference was added to the Kotlin docs: (here)
An auto-generated list of hard keywords for the current version can be found in Kotlin Github repo: (here)
There are more soft keywords, which behave like keywords in certain context, like it
, field
, object
, access & member modifiers.
More about context in which soft keywords are treated as keywords can be found in the grammar reference, along with the whole grammar, including hard keywords in their places.
There is a grammar reference https://kotlinlang.org/docs/reference/grammar.html
So anything in double quotes is a keyword (like "class"
) or an operator (like "%"
). However many keywords are "soft" (like "file"
), meaning that they depend on their syntactic position and still may be used as function names, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With