Asunto – Vocabulario Kotlin



Object es una clase especial en Kotlin que tiene solo una instancia, que puedes usar para crear Singletons fácilmente. En este episodio, veremos las diferencias entre implementar un Singleton en Java versus Kotlin, cómo puede crear Singleton en Kotlin sin usar la palabra clave static y qué sucede debajo del capó cuando se usa el objeto. Lista de reproducción #KotlinVocabulary → Suscríbete a desarrolladores de Android → #Kotlin #AndroidDev #Destacado

About MiReal

Compruebe también

Android Studio NUEVO Detalles explicados Logcat | Resumen de detalles | Cómo usar Logcat en Dolphin

Cómo usar el nuevo Logcat de Android Studio Dolphin, guía completa 1. Habilite el nuevo …

35 comentarios

  1. So clear, thanks a lot

  2. this video helped thanks

  3. Nice explanation 👍👍

  4. Does it get easier?

  5. Really confused here, if Object automatically creates a Singleton without the Java boilerplate why does something like Room Database creation still require all the synchronized block and @Volatile annotation same as in Java? You can see this in the official google Room Codelab here https://github.com/googlecodelabs/android-room-with-a-view/blob/kotlin/app/src/main/java/com/example/android/roomwordssample/WordRoomDatabase.kt

  6. Very nice explanations!

  7. So, what's the equivalent singleton in Kotlin? the video is ambiguous, if you explained about the singleton and its thread safety in Java, there should be side by side comparison in kotlin code. But, suddenly it jumped to Intellij Java to Kotlin Auto Conversion.

  8. I want this beanie 😍

  9. what does an instance of an object mean? is it different from the instance of a class?

  10. For curious, there is also one thing that anonymous objects in Kotlin can do unlike their Java's counterparts: implement multiple interfaces at once, like that: object : Interface1, Interface2 {}

  11. Thanks for demonstrating transparently.😊😊

  12. Kotlin has good precision. Since I started using it, I stopped using Java

  13. 6:34 There is no colon between object and braces

    var temp = object{

    var value = 2

    var another = 3

    }

  14. Do we really need a video on this?? This is already well documented in the Kotlin documentation.

  15. thanks for demonstrating expression based instantiation too.

  16. Coool 🤩🥰👍

  17. Not all of us come from a Java background. I'm new to Kotlin but I think this info would have been clearer to me if you spoke in Kotlin terms first and saved the Java analogies for later.

  18. Learning object oriented languages is wasting of time. Learn functional languages for instance Clojure. Updating a value in a nested data class structure in Kotlin is a big copy chain which is so cumbersome. In Clojure it's (assoc-in value [:users 4 :address :zip] 12345) for updating the zip code of the 5th user in a list.

  19. Super clear explanation , need more videos about kotlin like this

  20. Maybe something about delegates in the future? They're really special and powerful when used well, but I don't think many people know how to use them.

  21. So clear and fluent. Thanks 👍

  22. thank you sir

  23. More kotlin videos please!!

  24. Great video and awesome cap in the end

  25. Learning Kotlin for Android, made my first app with Java in 2016, anyone else self taught that managed to find employment?

  26. 7:03 Boy…. That escalated quickly.

  27. Hey, where did you get that hat ?

  28. The animations for the different threads are really well done 👍

  29. Nice explanation 😊

  30. Seriously I don't see any major advantage of "object" keyword for singleton in kotlin. Because
    * It does not support parameterized singleton
    * We can create singleton without "object" with just two more lines having a lot of control over it.

  31. Nice videos!! please make videos about other topics like generics, sealed classes, inline etc. Thank you

  32. I ♥️ object classes. I also ♥️ the Voltron in the background 😀

Deja una respuesta

Tu dirección de correo electrónico no será publicada.

Personel Sağlık

- istanbul eskort - izmir eskort - mersin eskort - adana eskort - antalya eskort - eskort mersin - mersin eskort bayan - eskort adana - Pet Simulator X Ban Bypass