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

后端 未结 7 1556
时光说笑
时光说笑 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 21:10

    You cane define like this

    1>

    List<Object[]> list = new ArrayList<Object[]>();
    

    Fetching

    list.get(i)[j];
    

    2>

    List<Map<Integer,Object>> list = new ArrayList<Map<Integer,Object>>();
    

    Fetching

    list.get(i).get(j);
    
    0 讨论(0)
提交回复
热议问题