Intersection on two list in java
AnswerBot
1y
Intersection of two lists in Java
Convert lists to sets and use retainAll() method
Iterate through one list and check if element is present in other list
Use Java 8 streams and filter() method
Help your peers!
Add answer anonymously...
Top DE Shaw Member Technology interview questions & answers
Top HR questions asked in DE Shaw Member Technology
Stay ahead in your career. Get AmbitionBox app
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+
Reviews
4 L+
Interviews
4 Cr+
Salaries
1 Cr+
Users/Month
Contribute to help millions
Get AmbitionBox app