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 - Наука та технологія
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)
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.
Awesome video, thank you for the tips & tricks on the usage of List & MutableList
Seen it was a bit since these have been uploaded and just want to say please do more!!! They are super helpful!
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.
Great series well done 👏🏽👏🏽
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)
Awesome high quality video 👍 Good job a always 🙂
PS: I wonder where the candy 🍬 went. Might come across it in later episodes perhaps? 😁
Well done!
Thank you so much for this excellent explanations.
Good sharing!
views is something we need to deal carefully. Thanks for sharing awesome content
nice
Amazing content! ❤ Jetbrains
I always learn a lot by this entertaining videos. Kotlin is so powerful. :)
today I learned something new about lists which is Views 🤯
When calling toList on a List does the function do a Shallow Copy of the List?
I wonder if Sebastian plays Starcraft2. He looks like he should.
Have a nice Kotlin!
What about search on lists
Subscribed just now.
I want to learn kotlin right from basics. Help me please
you are geniuses there =)
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.
So why kotlin don't have *LinkedList()* like java ???
คุณอ้วนขึ้นนะค่ะ
Using fruits images instead of characters makes it difficult to read them fast. Not so colorblind friendly.