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);
More Related Contents:
- Java Questions! About List and Objects
- Finding out if a list of Objects contains something with a specified field value?
- How do i get an object from another class in java
- .contains() on a list of objects [closed]
- get specific data filed from returned object in java
- How do I correctly implement this code segment without getting a logic error? [closed]
- What is the difference between a variable, object, and reference? [duplicate]
- How to avoid “ConcurrentModificationException” while removing elements from `ArrayList` while iterating it? [duplicate]
- Can we instantiate an abstract class?
- Is there a way to instantiate a class by name in Java?
- Polymorphism: Why use “List list = new ArrayList” instead of “ArrayList list = new ArrayList”? [duplicate]
- Remove duplicates from a list of objects based on property in Java 8 [duplicate]
- How to compare two java objects [duplicate]
- Java 8 stream reverse order
- Difference between Arrays.asList(array) and new ArrayList(Arrays.asList(array))
- How to copy Java Collections list
- Efficient intersection of two List in Java?
- Iteratively compute the Cartesian product of an arbitrary number of sets
- How to sort a List alphabetically using Object name field
- Java rules for casting
- Sort List in reverse in order
- What is a List vs. an ArrayList? [duplicate]
- Fastest Gaussian blur implementation
- Difference Between Object Type and Reference Type
- What does the ‘new’ keyword actually do in Java, and should I avoid creating new objects?
- Why didn’t Stream have a toList() method?
- Steps in the memory allocation process for Java objects
- Is it possible see all the references to an object in execution time?
- Performance and Memory allocation comparison between List and Set
- Converting an int array to a String array