This article introduces you to the basic Kotlin grammar.
๐ธ !!
!! converts T? to T. If the coverted object is null, app will throw a exeption.
val list: List<Int> = ... |
๐ ?.let
?.let ใฏ null ใใใชใๅ ดๅใซๅฆ็ใ่กใใกใฝใใใ
?.let is a function to process if an object is not null.
map[1]?.let { it + 5 } |
๐ init in Class
Pre-checking with init in an object disallows a malformed state:
class Age(private val ageInt: Int) { |
๐ค References
๐ฅ Recommended VPS Service
VULTR provides high performance cloud compute environment for you.
Vultr has 15 data-centers strategically placed around the globe, you can use a VPS with 512 MB memory for just $ 2.5 / month ($ 0.004 / hour).
In addition, Vultr is up to 4 times faster than the competition, so please check it => Check Benchmark Results!!