JavaRush
AI Academy
new
Promotion
Learning
Courses
Tasks
Quizzes
Games
Help
Schedule of nudges
Internship
Community
Users
Forum
Chat
Articles
Activities
Reviews
Subscriptions
Light theme

Lectures

  • Reviews
  • About us
  • CS50
Start
Start learning
Start learning
  • My progress
  • Courses
  • Quest map
  • Lectures
  • Lambda expressions: syntax, scopes

    JAVA 25 SELF
    48 level,0 lecture
    We review and dive deeper into lambda expressions in Java: syntax (parameters, the arrow ->, body), concise forms without parentheses and return, relationship with functional interfaces ( Comparator, Runnable, Consumer), everyday examples with lists, threads, and the Stream API. We cover scope and the “effectively final” rule, the difference in this between lambdas and anonymous classes, as well as common mistakes and how to avoid them.
    Open
  • Using lambdas in collections and streams

    JAVA 25 SELF
    48 level,1 lecture
    Practice of lambda expressions in collections and Stream API: how to replace anonymous classes with compact lambdas, use collection methods ( forEach, removeIf, sort, replaceAll) and build data-processing pipelines ( stream → filter → map → sorted → collect). We will compare them with anonymous classes, discuss “effectively final” variables, provide a table of the main operations, and analyse common pitfalls.
    Open
  • Advantages and disadvantages of lambda expressions

    JAVA 25 SELF
    48 level,2 lecture
    In this lecture, we discuss why Java gained lambda expressions: conciseness and readability, passing behavior as a parameter, integration with collections and the Stream API ( filter, map, forEach), capture of “effectively” final variables, and convenient callback syntax via the -> operator. In parallel, we’ll look at pitfalls: debugging long chains, overload ambiguity ( Runnable vs Callable), closure limitations, serialization, and nested lambdas. We conclude with practical recommendations on when to use lambdas and a review of common mistakes.
    Open
  • Closures in Java: nuances

    JAVA 25 SELF
    48 level,3 lecture
    In this lecture, we break down what a closure is and how it works in Java: how lambdas and anonymous classes “capture” outer variables, why local variables must be final or effectively final, how capturing local variables differs from accessing class fields, and how this behaves in lambdas and anonymous classes. We’ll show function factories with IntSupplier, look into the internal capture implementation, and cover typical mistakes (for example, the compiler message Variable used in lambda expression should be final or effectively final).
    Open
  • Anonymous classes: how they differ from lambdas, with examples

    JAVA 25 SELF
    48 level,4 lecture
    In this lecture we unpack what an anonymous class is in Java and how it differs from a lambda expression: syntax, capabilities (fields, additional methods, overriding toString/ equals), scope and the behavior of this, variable capture (only final/“effectively final”). Practical examples with Runnable, Comparator, Predicate, plus recommendations — when to choose a lambda and when an anonymous class.
    Open
Courses
  • Java Course
  • Python Course
  • Development with Claude Code
  • All 16 courses
University
  • Java FullStack
  • Python FullStack
  • AI Native Developer
  • Web FullStack
Community
  • Articles
  • Forum
  • Help with Tasks
Company
  • About us
  • Contacts
  • Reviews
  • Pricing
  • Questions and answers
JavaRush JavaRush: online courses in Java and other programming languages, where you learn by solving tasks. We started in 2012 with a Java course, and today there are 16 courses: Java and Spring, Python, web development, SQL, Go, C#, C++, Kotlin, Swift, Docker and AI development. More than 10,000 tasks with instant checks, and the first level of any course is free. Learn on your own or with a mentor at JavaRush University.
Follow us
Язык интерфейса
Русский
English
Українська
"Programmers are not born" © 2026 JavaRush Terms of Use and Privacy policy
MastercardVisa
"Programmers are not born" © 2026 JavaRush Terms of Use and Privacy policy