Remove Common Elements Two Lists Java

It may be required sometimes to remove common elements two lists Java. Following is the code. ArrayList al1 contains 10, 20 and 30 and ArrayList al2 contains 20, 30, and 50. It is required from al1 to remove 20 and 30 as they are also present in al2. After removal, al1 should print only 10. …

Remove Common Elements Two Lists Java Read More »