Kotlin/Collection
-
[Kotlin] List,Set,MapKotlin/Collection 2021. 9. 5. 16:09
2021.08.26 - [Kotlin/Collection] - [Kotlin] Collection hierachy List In Kotlin, the default implementation of List is ArrayList Two lists are considered equal if they have the same sizes and structurally equal elements at the same positions. class Person(var name:String, var age:Int) fun main() { val bob = Person("Bob", 31) val people = listOf(Person("Adam", 20), bob, bob) val people2 = listOf(P..
-
[Kotlin] Collection hierachyKotlin/Collection 2021. 8. 26. 14:45
read-only interface (Mutable이 붙지 않은 것들)- element의 값을 변경 불가 mutable interface (Mutable이 붙은 것들)- element의 값을 변경 가능( 삭제,변경,추가) interface Iterable Classes that inherit from this interface can be represented as a sequence of elements that can be iterated over. https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-iterable/ interface Collection : Iterable A generic collection of elements. M..