How to compare two different list object in java?

后端 未结 2 565
猫巷女王i
猫巷女王i 2020-12-20 09:16

I have two class lists like List A1 and List b1 and both lists contain one field which is common. So by using this fiel

2条回答
  •  醉话见心
    2020-12-20 09:35

    I'm not sure I fully understand the question, but you're asking for something like this?

    public boolean compare (List listA, List listB) {
        if (listA.size() != listB.size () return false;
        for (int i=0; i

    Both lists should be sorted by that commonField field

提交回复
热议问题