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.

The function interface

The function interface - Java Tutorial

From the course: Functional Programming with Java

Start my 1-month free trial

The function interface

- [Instructor] So I mentioned previously the functional programming treats functions as first class citizens. Meaning that as functional programmers, we need to get used to treating functions in a very similar way to other types such as strings, integers, objects, or any other type in Java. Over the course of the next few videos, we're going to take a look at how exactly to start doing this, as well as what this means for our code and a few other useful things that we can do with it. So let's start off with the fact that the concept of first class functions, means that we can define functions as variables. Here's what I mean by that. If you're like most Java programmers, it's very likely that the only way you've ever seen to define functions is as methods of a class. For example, if you have a person class, as we have here, you might have a method called getName or setAge that interacts in some way with the classes member variables. So our first step into first class functions then is…

Contents