본문 바로가기 메뉴 바로가기

Programming makes everything

프로필사진
  • Git Blog
  • GitHub
  • LinkedIn
  • Facebook
  • Instagram
  • Email

Programming makes everything

검색하기 폼
  • All Categories
    • Architecture
      • Front-End
      • Back-End
      • Design Pattern
    • Computer Language
      • Scala
      • Kotlin
      • Python
      • Java
    • Data Engineering
      • Spark
      • HQL
      • Airflow
    • Development Tools
      • IntelliJ
      • GitHub
  • 방명록

[Kotlin] How to convert List to an array in Kotlin?

First, implement convert function private inline fun toArray(list: List): Array { return (list as List).toTypedArray() }and then convert list to array with this function val list:List = lisfOf("harry", "potter") val array = toArray(list)If you need to put array value to vararg parameter to Java Function, you need to put * front of variable val familyName = getFamilyName(*array)When will vararg n..

Computer Language/Kotlin 2019. 9. 3. 08:28
이전 1 다음
이전 다음
TAG
  • kotlin
  • idea
  • NPE
  • Gradle
  • Kotlin 1.3
  • IntelliJ
  • Ultimate Edition
  • NullPointerException
  • Java
  • spring boot
more
Recent Post
Follow
  • Blog
  • Github
  • LinkedIn

Blog is powered by Tistory / Designed by Tistory / Management Page

티스토리툴바