Learning Java Lambdas an in-depth look at one of the most important features of modern Java

Understand and utilize Java Lambdas About This Book Take a deep dive into one of the single most important additions to modern Java Master Java lambdas, and fully understand functions, classes, and scope. Improve your programming skills, which will enable you to write cleaner and more dynamic code W...

Descripción completa

Detalles Bibliográficos
Otros Autores: Weston, Toby, author (author)
Formato: Libro electrónico
Idioma:Inglés
Publicado: Birmingham, England : Packt Publishing 2017.
Edición:1st edition
Materias:
Ver en Biblioteca Universitat Ramon Llull:https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009630079206719
Tabla de Contenidos:
  • Cover
  • Copyright
  • Credits
  • About the Author
  • www.PacktPub.com
  • Customer Feedback
  • Table of Contents
  • Preface
  • Chapter 1: Introduction
  • The road to modern Java
  • Modern Java features
  • Chapter 2: Lambdas Introduction
  • λs in functional programming
  • 1930s and the lambda calculus
  • 1950s and LISP
  • What is a lambda
  • Functions vs classes
  • Lambdas in modern Java
  • Some theoretical differences
  • Functions vs classes
  • Some concrete differences
  • Capture semantics
  • Shadowed variables
  • Summary
  • λ basic syntax
  • Syntax breakdown
  • Summary
  • Chapter 3: Lambdas in Depth
  • Functional interfaces
  • @FunctionalInterface
  • Extension
  • Other interface improvements
  • Summary
  • Type inference improvements
  • Java type inference
  • Target-typing for lambdas
  • Type parameters in method calls
  • Type parameters in chained method calls
  • Method references
  • Example
  • Method reference types
  • Constructor reference
  • Static method reference
  • Instance method reference of particular object (in this case, a closure)
  • Instance method reference of a arbitrary object whose instance is supplied later (lambda)
  • Summary
  • Scoping
  • Effectively final
  • Circumventing final
  • Exception handling
  • Using a callback
  • Dealing with exceptions when writing lambdas
  • As a caller (dealing with exceptions when calling lambdas)
  • Lambdas vs closures
  • Basic differences
  • Other differences
  • Summary
  • Bytecode recap
  • Descriptors
  • Converting a method signature
  • Code examples
  • Example 1
  • Example 2
  • Example 3
  • Example 4
  • Example 4 (with method reference)
  • Example 5
  • Summary
  • Appendix: Bytecode
  • WaitFor
  • Example 1
  • Example 2
  • Example 3
  • Example 4
  • Example 4 (with Method Reference)
  • Example 5
  • Index.