I have two array lists e.g.
List<Date> a;
contains : 10/10/2014, 10/11/2016
List<Date> b;
contains : 10/10/2016
How can i do a check between list a
and b
so the value that is missing in b
is returned?e.g. 10/10/2014
You can convert them to Set
collections, and perform a set difference operation on them.
Like this:
Set<Date> ad = new HashSet<Date>(a);
Set<Date> bd = new HashSet<Date>(b);
ad.removeAll(bd);