목록shffled (1)
코린이 탈출기
shuffle()과 shuffled()는 리스트의 값들을 섞고 싶은 경우 사용하는 것입니다. 밑의 사진과 코드는 shuffle()과 shuffled()의 코드입니다. 코드를 보며 설명한 후 사용 예시를 작성하겠습니다. /** * Randomly shuffles elements in this mutable list. */ @kotlin.internal.InlineOnly @SinceKotlin("1.2") public actual inline fun MutableList.shuffle() { java.util.Collections.shuffle(this) } /** * Returns a new list with the elements of this list randomly shuffled. */ @Sinc..
코틀린
2022. 7. 4. 00:57