July 2018
Intermediate to advanced
400 pages
12h 14m
English
If you have not used function types before, you may wonder why you would want to use them in your program. Our answer: Function types offer increased flexibility with less boilerplate. Consider a language that does not offer function types, like Java 8.
Java 8 includes support for object-oriented programming and lambda expressions but does not include the ability to define a function as a parameter to a function or variable. Instead, Java provides anonymous inner classes – nameless classes that are defined within another class to implement a single method definition. You can pass anonymous inner classes as an instance, like a lambda. For example, in Java 8, to pass the definition ...
Read now
Unlock full access