How to retrieve data from ArrayList consists of array objects

前端 未结 6 1455
清歌不尽
清歌不尽 2021-01-23 23:23

My arraylist contains String array objects. How Can I get all values? My code is below,

String cordinates1c,cordinates2l,cordinates2m;                   
String[         


        
6条回答
  •  攒了一身酷
    2021-01-24 00:05

    Are you looking for something like this ?

    String cordinates1c = "1", cordinates2l = "2", cordinates2m = "3"; 
    String[] array1 = {cordinates1c, cordinates2l, cordinates2m};      
    String[] array2 = {cordinates1c, cordinates2l, cordinates2m};      
    
    List alist=new ArrayList();                  
    alist.add(array1);                                                 
    alist.add(array2);                                                 
    for (String[] strings : alist) {                                   
        System.out.println(StringUtils.join(strings));                 
    }  
    

    Output: 123 123

提交回复
热议问题