Kotlin Lists 2022

Поділитися
Вставка
  • Опубліковано 25 лип 2024
  • This blog post accompanies this episode: dev.to/kotlin/exploring-kotli...
    In today’s episode of Standard Library Safari, we’re learning all about lists! They’re the most popular kind of Kotlin collection for good reason, and we spend a whole episode diving into the details. We learn about how to create lists and mutable lists, and how to access, add, and remove elements. Together, we explore functionality around providing default values for invalid indexes, slicing, and mutating values using Kotin’s out-of-the-box features. We’ll also explore the concept of views on lists, investigate sub-lists and reversed views, and share many other tips and tricks.
    0:00 In today’s episode: Lists!
    0:25 Intro
    0:33 Creating lists
    2:08 Accessing elements
    3:36 Getting multiple items: slice
    4:35 Mutable lists
    5:00 Creating mutable lists
    5:28 Adding elements
    6:02 Removing elements
    6:59 Updating elements
    7:15 Filling and clearing mutable lists
    8:04 Shuffling, sorting, reversing, and more
    8:38 Retaining or removing elements
    9:16 Views on lists
    11:25 Wrapping up
    #collections #kotlin #jvm #programming #lists
    Kotlin website → kotlinlang.org/
    Kotlin documentation → kotlinlang.org/docs/home.html
  • Наука та технологія

КОМЕНТАРІ • 26

  • @raphaeltarita5187
    @raphaeltarita5187 3 роки тому +11

    Amazing content, as always! The Kotlin standard library safari is definitely my favourite series on this channel! Also, I did not know before that Kotlin has undefined behaviour (although very limited of course)

    • @InXLsisDeo
      @InXLsisDeo Рік тому

      It's undefined behaviour due to the algorithms, unlike C or C++ where UB is inherent to (some aspects of) the language. Kotlin the language, being based on the JVM which doesn't have UB, doesn't have UB either.

  • @OldManRog
    @OldManRog 3 роки тому +3

    Awesome video, thank you for the tips & tricks on the usage of List & MutableList

  • @jordanray1537
    @jordanray1537 Рік тому

    Seen it was a bit since these have been uploaded and just want to say please do more!!! They are super helpful!

  • @victoryghor9009
    @victoryghor9009 Рік тому

    This is the best educational video I have seen, I like so much kaolin and I thought it was really cool how you explained it in a relaxed way.

  • @TamirOmara
    @TamirOmara 7 місяців тому

    Great series well done 👏🏽👏🏽

  • @JolanRensen
    @JolanRensen 3 роки тому +4

    Now know the difference between .reversed() and .asReversed()!
    Actually it makes sense, since the "as" part in function names almost almost indicates that you're providing a different view or perspective on an object (in comparison to "to" which always provides a new copy of it)

  • @SolaLupus
    @SolaLupus 3 роки тому +4

    Awesome high quality video 👍 Good job a always 🙂
    PS: I wonder where the candy 🍬 went. Might come across it in later episodes perhaps? 😁

  • @LeHoangTu
    @LeHoangTu 3 роки тому +3

    Well done!

  • @hinocenciopaulo
    @hinocenciopaulo Рік тому

    Thank you so much for this excellent explanations.

  • @HtopSkills
    @HtopSkills 3 роки тому +2

    Good sharing!

  • @navczydev
    @navczydev 3 роки тому

    views is something we need to deal carefully. Thanks for sharing awesome content

  • @techdevmt7816
    @techdevmt7816 3 роки тому +3

    nice

  • @gyorffydanielJP
    @gyorffydanielJP 3 роки тому +1

    Amazing content! ❤ Jetbrains

  • @CommanderSteps
    @CommanderSteps 3 роки тому +4

    I always learn a lot by this entertaining videos. Kotlin is so powerful. :)

  • @abdonasr1222
    @abdonasr1222 3 роки тому +2

    today I learned something new about lists which is Views 🤯

  • @pixelPlex
    @pixelPlex 3 роки тому

    When calling toList on a List does the function do a Shallow Copy of the List?

  • @TimSchraepen
    @TimSchraepen 3 роки тому

    I wonder if Sebastian plays Starcraft2. He looks like he should.
    Have a nice Kotlin!

  • @tonygrace2735
    @tonygrace2735 2 роки тому +1

    What about search on lists

  • @jsr1530
    @jsr1530 3 роки тому +1

    Subscribed just now.

    • @jsr1530
      @jsr1530 3 роки тому

      I want to learn kotlin right from basics. Help me please

  • @andrey7530
    @andrey7530 2 роки тому

    you are geniuses there =)

  • @xiao2634
    @xiao2634 2 роки тому

    If [] is translated to calling get(), why can't Kotlin provide get(slice : Pair) and get(slice: Range) polymorph functions to work as the slice function. This way we can write list[1 to 3] instead of list.slice(1 to 3). Of course, we can extend the List.get() ourselves, but I am just wondering why Kotlin does not provide that in its standard library.

  • @nomatter2444
    @nomatter2444 3 роки тому

    So why kotlin don't have *LinkedList()* like java ???

  • @MeManeenotOpal
    @MeManeenotOpal Рік тому

    คุณอ้วนขึ้นนะค่ะ

  • @SulavTimsina
    @SulavTimsina 2 роки тому

    Using fruits images instead of characters makes it difficult to read them fast. Not so colorblind friendly.