Top "Kotlin" questions

Kotlin is an open-source, statically typed programming language supported and developed by JetBrains.

Getters and Setters in Kotlin

In Java, for example, I can write getters on my own (generated by IDE) or use Annotations like @Getter in …

kotlin getter-setter
How to check "instanceof " class in kotlin?

In kotlin class, I have method parameter as object (See kotlin doc here ) for class type T. As object I …

kotlin kotlin-extension
error: failed linking references. -> QueuedJob

I was studying the Android Material Design using Kotlin and everything was going fine until I tried to use the …

android kotlin android-gradle-plugin android-appcompat floating-action-button
Best way to null check in Kotlin?

Should I use double =, or triple =? if(a === null) { //do something } or if(a == null) { //do something } Similarly for 'not …

kotlin kotlin-null-safety
Kotlin: how to pass a function as parameter to another?

Given function foo : fun foo(m: String, bar: (m: String) -> Unit) { bar(m) } We can do: foo("a …

kotlin
How to create an empty array in kotlin?

I'm using Array(0, {i -> ""}) currently, and I would like to know if there's a better implementation such as …

arrays kotlin
How to get generic parameter class in Kotlin

Firebase's snapshot.getValue() expects to be called as follows: snapshot?.getValue(Person::class.java) However I would like to substitute …

generics kotlin
`break` and `continue` in `forEach` in Kotlin

Kotlin has very nice iterating functions, like forEach or repeat, but I am not able to make the break and …

loops foreach lambda kotlin
Kotlin - Wait function

Is there a wait function in kotlin? (I don't mean a Timer Schedule, but actually pause the execution). I have …

kotlin wait
How to get the current index in for each Kotlin

How to get the index in a for each loop? I want to print numbers for every second iteration For …

android for-loop kotlin