How can I know the different element between 2 array list in java? I need the exact element not a Boolean value which can be retrieved using removeAll()
.
Use Apache Commons Collections (javadoc):
CollectionUtils.disjunction(a, b);
See also: Effective Java, 2nd edition, Item 47: Know and use the libraries (The author mentions only the JDK's built-in libraries but I think the reasoning could be true for other libraries too.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With