Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
What does the forEach method do in a collection?
Think about actions performed on each item.
What does the removeIf method do?
Focus on conditions that trigger removal.
What method allows you to iterate over elements in a collection and execute an action?
Focus on iteration methods.
True or False: The removeIf method can remove items from a collection based on a predicate defined in a lambda expression.
Think about the ability to filter items.
Write a Java program that initializes a list of random integers between 1 and 100, removes all even numbers and sorts the list in descending order. Print the final list.
Think about how to define your conditions for removing and sorting.
Discuss how lambda expressions impact the readability of code compared to traditional loops. Provide an example for clarity.
Consider how the structure of your code changes.
5 more questions in this section. Enroll free to practise them all.
Enroll free