qq_29295319
他们都叫我Eason
2017-11-15 06:10

如何快速高效的比较两个List<String []>对象,里面的数值完全相等。

  • 对象
  • string
  • arraylist
    List<String[]> list1 = new ArrayList<>();
    List<String[]> list2 = new ArrayList<>();
    String [] line1 = new String[] {"3","4","5","6","7"};
    String [] line2 = new String[] {"3","4","5","6","7"};
    String [] line3 = new String[] {"4","5","6","7","8"};
    String [] line4 = new String[] {"4","5","6","7","8"};
    list1.add(line1);list1.add(line3);
    list2.add(line2);list2.add(line4);
    两个list中所存的String数组数值是一样的,做指向地址不一样,用list的retainAll(),containsAll(),removeAll()均无法解决。
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

3条回答