Variables in Kotlin are not any more volatile than they are in Java. They certainly don’t get the volatile keyword. Kotlin does however try to be thread-safe by default though as long as you don’t break your thread safety yourself (you need to provide some sort of synchronization (volatile, synchronized, locks)).
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
Extension to ?.let syntax | 7 | 3543 | February 20, 2020 | |
Not null check
|
9 | 3441 | January 31, 2022 | |
Proper usage of nullable vars after check for nullness
|
16 | 1747 | January 19, 2015 | |
Double bang vs checkNotNull?
|
7 | 10071 | May 31, 2018 | |
What is the best way to write if null then initialize it? | 13 | 49294 | July 13, 2021 |