How to make ArrayList that work as two dimentional array in java?

后端 未结 7 1553
时光说笑
时光说笑 2021-01-23 20:16

I want to make arrayList object in java that work as two dimentional array. My question is how can we access value from specific dimention from arrayList.

in two diment

7条回答
  •  一生所求
    2021-01-23 20:48

    An arraylist is not an object to make a 2 dimentional arrays. However you can use it anyway : You can use :

    new ArrayList>; //or
    new ArrayList; 
    

    But you should implement your own matrix class because you will probably have some check to do and a function get(int row, int column) would be cool

提交回复
热议问题