spot_valantino
New Member
I know that we can use the \[code\]containsAll\[/code\] method while comparing two \[code\]ArrayLists\[/code\] to check if one is a subset of the other. But this is what I would like. Consider an \[code\]ArrayList super = 1,2,3,4,5,6,7,8,9,10\[/code\] and an \[code\]ArrayList sub1 = 1,2,3,4\[/code\] and another \[code\]ArrayList sub2 = 2,4,6,8\[/code\]. Now, if I did \[code\]super.containsAll(sub1)\[/code\], it would evaluate to \[code\]true\[/code\] because \[code\]sub1\[/code\] is contained within \[code\]super\[/code\]. If I did \[code\]super.containsAll(sub2)\[/code\], it would also evaluate to \[code\]true\[/code\] because the numbers 2,4,6 and 8 are contained in \[code\]super\[/code\]. I would like to know if there's a way to check two \[code\]ArrayLists\[/code\] so that \[code\]super.containsAll(sub2)\[/code\] evaluates to \[code\]false\[/code\] as the numbers in \[code\]sub2\[/code\] don't appear in the same order in \[code\]super\[/code\].