News and announcements of the library. No books here.
??Official Chinese channel: t.me/zlib_china_official
? https://singlelogin.re
https://en.wikipedia.org/wiki/Z-Library
? https://twitter.com/Z_Lib_official
? https://mastodon.social/@Z_Lib_official
Last updated 3 months, 4 weeks ago
Intel slava is a Russian News aggregator who covers Conflicts/Geopolitics and urgent news from around the world.
For paid promotions and feedback contact us at: @CEOofBelarus
Last updated 1 month ago
?Welcome to the best book channel of Telegram.
✨Buy ads: https://telega.io/c/BooksHub25
✨Contact admin ➠ @Bookshub_contact_bot
✨ Off Topic Community➠ @BooksHubCommunity
✨ Copyright Disclaimer➠ https://telegra.ph/LEGAL-COPYRIGHT-DISCLAIMER-09-18
Kotlin Extension Functions
Kotlin dasturlash tilining yana bir ajoyib qulayliklaridan biri bu - classlarning kodlariga tegmasdan yoki ulardan nasil olmay turib yangi funksional qoshish imkonini beruvchi extension funksiyalar. Bu qulaylik sizga standart kutubxonalardagi classlarga qoshimchalar qilishda juda kerak bo'ladi.
Extension funksiyalarni e'lon qilishda funksional qoshiladigan class nomi ortidan nuqta qoyilgan holda funsiya nomini yozish kerak bo'ladi. Misol uchun:
kotlin
```
fun String.reverse(): String {
return this.reversed()
}
```
Ushbu koddagi this kalit so'zi orqali ushbu funksiya chaqirilgan obyektga murojat qilish mumkin bo'ladi va bu funksiyani obyektning qolgan funksiyalari kabi chaqirish
kotlin
mumkin bo'ladi.
```
val name = "Kotlin"
val reversed = name.reverse()
// "niltoK"
```
Bundan tashqari siz toplamlar kabi generic turlar uchun ham extension funsiya yozishingiz mumkin
```
fun List.shuffle(): List {
return this.toMutableList().apply {
Collections.shuffle(this)
}
}
```
Ertalabdan savol, ketadiyuu
Quyidagi ko'rinishda e'lon qilingan data class bilan qanday muammo bo'lishi mumkin?
```
data class A(var someVar: String)
```
Javobni izohlarda qoldiring
Hey Hey Hey ? KotlinPedia kanaliga xush kelibsiz. ?
Ushbu kanalda siz Kotlin dasturlash tilining eng nozik va o'ziga xos jihatlari bilan tanishishingiz, unda bo'layotgan o'zgarishlar va yangiliklardan boxabar bo'lishingiz mumkin bo'ladi.
Bundan tashqari kanalda Kotlin haqida kichik test va viktorinalar ham e'lon qilib boriladi va ularga javob topish orqali siz o'z bilimlaringizni mustahkamlab ham borishingiz mumkin.
Qiziqarli va foydali content hali oldinda! Shunday ekan kanalga obuna bo'ling va kuzatishda davom eting. ?
News and announcements of the library. No books here.
??Official Chinese channel: t.me/zlib_china_official
? https://singlelogin.re
https://en.wikipedia.org/wiki/Z-Library
? https://twitter.com/Z_Lib_official
? https://mastodon.social/@Z_Lib_official
Last updated 3 months, 4 weeks ago
Intel slava is a Russian News aggregator who covers Conflicts/Geopolitics and urgent news from around the world.
For paid promotions and feedback contact us at: @CEOofBelarus
Last updated 1 month ago
?Welcome to the best book channel of Telegram.
✨Buy ads: https://telega.io/c/BooksHub25
✨Contact admin ➠ @Bookshub_contact_bot
✨ Off Topic Community➠ @BooksHubCommunity
✨ Copyright Disclaimer➠ https://telegra.ph/LEGAL-COPYRIGHT-DISCLAIMER-09-18