Java 8 Quiz Challenge 00:10:00 Welcome to your Java 8 Mastery Quiz: Test Your Knowledge! 1. Which method is used to create an infinite stream in Java 8? filter() generate() limit() map() None 2. How is a method reference represented in Java 8? >> => :: -> None 3. What is a lambda expression in Java 8? A collection data structure An anonymous function A type of variable A lightweight thread None 4. Which interface is used to define custom functional interfaces in Java 8? Function Predicate Consumer @FunctionalInterface None 5. Which method is used to terminate a stream and collect its elements into a collection? map() collect() forEach() filter() None 6. What does the map() method in the Stream API do? Applies a function to each element Filters elements based on a predicate Reduces elements to a single value Sorts elements in natural order None 7. Which interface is a functional interface in Java 8? Serializable Comparator Callable Runnable None 8. What is the purpose of the forEach() method in Java 8 streams? To filter elements based on a predicate To iterate over elements in a collection To sort elements in natural order To collect elements into a collection None 9. What does the reduce() method in Java 8 streams do? Filters elements based on a predicate Applies a function to each element Combines elements into a single value Sorts elements in natural order None 10. Which functional interface represents a supplier of results? Consumer Supplier Function Predicate None Please share your feedback in the comment box below. Congratulations on completing the Java 8 Mastery Quiz! Explore Java 8 concepts further at JavaDZone. Name Email Time's upTime is Up!