Kotlin threads exemple

Exemples de code

5
0

kotlin fil

runBlocking {
    val job = launch(Dispatchers.Default) {  
        println("${Thread.currentThread()} has run.") 
    }
}
1
0

fil de kotlin

/// this code is actaully for kotlin but works in Java with changes.

Thread(Runnable{
  	// here goes you code that runs in the background
    }).start()

Pages connexes

Pages d'exemples similaires

Dans d'autres langues

Cette page est dans d'autres langues

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................