From the course: Functional Programming with Java

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

BiFunctions and beyond

BiFunctions and beyond - Java Tutorial

From the course: Functional Programming with Java

Start my 1-month free trial

BiFunctions and beyond

- [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, except it applies to functions…

Contents