v1.6.21
  • Solutions
    • Multiplatform Mobile
    • Multiplatform for other platforms
    • Server-side
    • Web frontend
    • Data science
    • Android
  • Docs
  • Community
  • Teach
  • Play
    • Playground
    • Hands-on
    • Examples
    • Koans
← Docs
kotlin-stdlib / kotlin.collections / MutableList / add

add

Common
JVM
JS
Native
1.0
abstract fun add(element: E): Boolean
(Common source) (Native source)

Adds the specified element to the end of this list.

Return true because the list is always modified as the result of this operation.

Common
JVM
JS
Native
1.0
abstract fun add(index: Int, element: E)
(Common source) (Native source)

Inserts an element into the list at the specified index.

Stay in touch:
  • Contributing to Kotlin
  • Releases
  • Press Kit
  • Security
  • Blog
  • Issue Tracker
  • Brand assets
  • Careers
Kotlin™ is protected under the Kotlin Foundation and licensed under the Apache 2 license.
Supported and developed by JetBrains
esc