The Java function interface only works with functions that take one argument. For functions that take different numbers of arguments, you need to use or create different interfaces. In this video, see how other interfaces, such as BiFunctions work, as well as how to create new functional interfaces.
- [Narrator] So at this point, … assuming you've been understanding everything so far, … one of the burning questions you probably have is, … so far, I've only shown you how to use … the function interface … to define functions with one argument. … But is there a way to use the function interface … with functions that have more than one argument, … or functions that have no arguments at all? … Well, fortunately, the answer to this question is yes. … When doing functional programming in Java, … it's possible to work with functions that have … any number of arguments. … The only slightly annoying thing … is that it's not always quite as simple … as using the stock function interface, … which as you'll have noticed by now … only works with functions that take one argument. … The first thing we going to take a look at here … is another functional programming interface in Java. … And this interface is called BiFunction. … Basically, the BiFunction interface … is exactly like the function interface, …
Skill Level Advanced
Java Design Patterns: Structuralwith Bethan Palmer1h 38m Intermediate
1. Introduction to Functional Programming
2. First-Class Functions
3. Working with Streams in Java
4. Advanced Concepts
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.