Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Mobile Development
  3. Android
  4. How to declare a two dimensional ArrayList in Kotlin

How to declare a two dimensional ArrayList in Kotlin

Scheduled Pinned Locked Moved Android
androidhelptutorialquestion
5 Posts 3 Posters 37 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Victor Farkas
    wrote on last edited by
    #1

    Hi I'm new to Kotlin and I would like to declare an two-dimensional ArrayList (450/10) But it didn't work - tried different versions like

    ArrayList>

    or

    arrayListOf(arrayListOf())

    But it seems not the right one Can someone help me?

    L H 2 Replies Last reply
    0
    • V Victor Farkas

      Hi I'm new to Kotlin and I would like to declare an two-dimensional ArrayList (450/10) But it didn't work - tried different versions like

      ArrayList>

      or

      arrayListOf(arrayListOf())

      But it seems not the right one Can someone help me?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      It is not clear what you are actually trying to do. But maybe one of the other collection classes would be a better choice: see kotlin.collections - Kotlin Programming Language[^].

      V 1 Reply Last reply
      0
      • L Lost User

        It is not clear what you are actually trying to do. But maybe one of the other collection classes would be a better choice: see kotlin.collections - Kotlin Programming Language[^].

        V Offline
        V Offline
        Victor Farkas
        wrote on last edited by
        #3

        I would like a data structure like this a b c d e f a b c d e f a b c d e f a b c d e f and would like to access [2][3]=c

        L 1 Reply Last reply
        0
        • V Victor Farkas

          I would like a data structure like this a b c d e f a b c d e f a b c d e f a b c d e f and would like to access [2][3]=c

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          It's all described in the Kotlin documentation at https://kotlinlang.org/docs/arrays.html[^].

          1 Reply Last reply
          0
          • V Victor Farkas

            Hi I'm new to Kotlin and I would like to declare an two-dimensional ArrayList (450/10) But it didn't work - tried different versions like

            ArrayList>

            or

            arrayListOf(arrayListOf())

            But it seems not the right one Can someone help me?

            H Offline
            H Offline
            HarrySto
            wrote on last edited by
            #5

            Quote:

            It will be useful to try a code analysis tool, such as AppRefactoring

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups