Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Java remove item from arraylist

Pardon the French names for variables, it do be like that. But I was wondering if I could use a third removeif function to remove grande and petites from original and then show original with the removed values. I know I could use a for loop and I might be getting ahead of myself as beginner but I am trying out new stuff.

the code

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

First, never post code as an image. Second, yes of course you can have such a removeIf. Basically, you want to remove the value if the value is in grande or in petites. Like,

original.removeIf(v -> grande.contains(v) || petites.contains(v));
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading