Skip to content
javabypankaj
HomeLibraryPopularCommunity
06
Java Streams, Lambda & Functional Programming
30 topics · 328 questions
1Lambda Expressions0/552Functional Interfaces0/13133Method References0/54Default & Static Methods in Interfaces0/335Stream API Fundamentals0/886Stream: filter0/19197Stream: map & Transform0/34348Stream: flatMap0/779Stream: Sorting & Comparator0/232310Stream: reduce & Aggregate0/9911Stream: Grouping & Partitioning0/222212Collectors0/212113Optional0/9914Primitive Streams0/2215Stream Creation & Utilities0/181816Parallel Streams0/101017Stream: Exception Handling0/4418Stream: Performance & Pitfalls0/5519Stream: Predict the Output0/7720Stream Practice: Employee Analysis0/434321Stream Practice: String & Character0/111122Stream Practice: Collections & Numbers0/111123Stream: Complex Pipelines0/8824Date/Time API0/2225Java 11 Features0/5526Java 17 Features0/3327Java 21+ Features0/101028Java 24/25 Preview0/8829Records0/1130Functional Programming Concepts0/22
1Lambda Expressions52Functional Interfaces133Method References54Default & Static Methods in Interfaces35Stream API Fundamentals86Stream: filter197Stream: map & Transform348Stream: flatMap79Stream: Sorting & Comparator2310Stream: reduce & Aggregate911Stream: Grouping & Partitioning2212Collectors2113Optional914Primitive Streams215Stream Creation & Utilities1816Parallel Streams1017Stream: Exception Handling418Stream: Performance & Pitfalls519Stream: Predict the Output720Stream Practice: Employee Analysis4321Stream Practice: String & Character1122Stream Practice: Collections & Numbers1123Stream: Complex Pipelines824Date/Time API225Java 11 Features526Java 17 Features327Java 21+ Features1028Java 24/25 Preview829Records130Functional Programming Concepts2
30 topics328 Qs0%
01Core Java17002OOP3203Collections6704Exception Handling2805Concurrency & Multithreading12706Java Streams, Lambda & Functional Programming32807Spring & Spring Boot2608Transactions3209JPA & Hibernate6910Microservices19411Kafka & Messaging9112DevOps, CI/CD & Tooling13313Database & SQL14114REST API & Web4015Design Patterns & LLD5716Advanced Java7117Coding Problems: DSA49218AWS & Cloud4119Data Engineering19420QA, Testing & SDET4121System Design3522Security2023Behavioral / HR: STAR Method37
30Topics
328Questions
0%Complete
3 of 30 topics
Topics
1Lambda Expressions0/552Functional Interfaces0/1313
3Method References0/55
4Default & Static Methods in Interfaces0/335Stream API Fundamentals0/886Stream: filter0/19197Stream: map & Transform0/34348Stream: flatMap0/779Stream: Sorting & Comparator0/232310Stream: reduce & Aggregate0/9911Stream: Grouping & Partitioning0/222212Collectors0/212113Optional0/9914Primitive Streams0/2215Stream Creation & Utilities0/181816Parallel Streams0/101017Stream: Exception Handling0/4418Stream: Performance & Pitfalls0/5519Stream: Predict the Output0/7720Stream Practice: Employee Analysis0/434321Stream Practice: String & Character0/111122Stream Practice: Collections & Numbers0/111123Stream: Complex Pipelines0/8824Date/Time API0/2225Java 11 Features0/5526Java 17 Features0/3327Java 21+ Features0/101028Java 24/25 Preview0/8829Records0/1130Functional Programming Concepts0/22

Method References

Java Streams, Lambda & Functional Programming·Topic 3 of 30·5 questions
Q1What are the four types of method references?

Four types: Class::static, object::instance, Class::instance (stream element is receiver), and Class::new, all replacing lambdas that call one existing method.

Read Answer
Q2Rewrite (a, b) -> a.compareTo(b) as String::compareTo

(a, b) -> a.compareTo(b) equals String::compareTo: the first argument is the receiver, the second is the method's argument.

Read Answer
Q3Rewrite a lambda e -> e.getName() as a method reference Employee::getName

e -> e.getName() is exactly Employee::getName: the lambda parameter becomes the method receiver.

Read Answer
Q4Use a constructor reference Employee::new to create employees from a stream of data

Employee::new is a factory reference: feed it data and it calls the matching constructor to build objects.

Read Answer
Q5Use an instance method reference on a specific object System.out::println for forEach

System.out::println is a bound reference: the receiver is the specific System.out object, so forEach prints each element.

Read Answer
Previous · Topic 2Functional Interfaces13 questionsNext · Topic 4Default & Static Methods in Interfaces3 questions
javabypankaj© 2026 javabypankaj
PrivacyTerms
HomeSearchLibrary