FunctionalInterface is an interface with :

  • only one abstract method.
  • zero or several default methods (with body).

Thus, the compiler will be able to find the method corresponding to the lambda you will pass.

Eg;

@FunctionalInterface
public interface Supplier<T> {
    T get();
    default String greet() {
        return "Hello, World ";
    }
    default String greet2() {
        return "Hello, World 2";
    }
}

Thus java will easily find the right (abstract) method because is is unique.

        Supplier<Car> fordCarProvider = () -> new Car("Ford", 1500, 4, 43000);
        Supplier<Car> bmwCarProvider = () -> new Car("BMW", 1500, 4, 83000);

        System.out.println(fordCarProvider.get());
        System.out.println(bmwCarProvider.get());

But in case you have several abstract method, it is no more a FunctionalInterface. Because ambiguity might occur.

// No more @FunctionalInterface
public interface Supplier<T> {
    T get();
    String greet();
    default String greet2() {
        return "Hello, World 2";
    }
}
Answer from g.momo on Stack Overflow
๐ŸŒ
Medium
medium.com โ€บ @qingedaig โ€บ java-functional-interface-vs-normal-interface-76889460bfd4
Java functional interface vs normal interface | by Alice Dai | Medium
November 11, 2024 - Normal Interface: Can have multiple abstract methods, allowing you to define a variety of behaviors that implementing classes must handle. Functional Interface: Can have multiple default and static methods, as they donโ€™t affect its status as a functional interface (since only the single abstract method matters for lambda compatibility).
๐ŸŒ
DEV Community
dev.to โ€บ johnscode โ€บ interface-vs-functional-interface-523m
Interface v.s. Functional Interface - DEV Community
June 29, 2024 - An interface may inherit from multiple interfaces. It may contain abstract methods, constants, static methods and default methods. ... Functional interface can also be called a single abstraction interface.
Discussions

What's the difference between using function types and functional interfaces as listeners/callbacks?
The difference is mostly semantic: what does it "mean" to the person using it? The main, practical, difference is that a functional interface is just a regular object interface that comes with its own factory function- you can make instances by "calling" this auto-generated factory function and passing a lambda. A function type is, well, a function- not an object. The difference is negligible for the downstream implementer of the type. The difference is mostly in how the author intends to use a provided instance of the type. If you do a functional interface, you'll use it with a dot-notation method call, and if you do a function type, you'll just invoke it directly. So, again, it's all about semantics. Do you want to communicate that the thing in question is "an object that does a thing" or do you want to communicate that the thing in question is "an operation"? There is one more difference that's sometimes worth thinking about, which is that since a functional interface is just an interface, it means that a user must pass in something that was explicitly created for the purpose of being used in that way. A function type is obviously satisfied by any function/method that happens to have the same signature. I'm not sure that's ever really a problem, but maybe if you have a bunch of function types and some of them share the same signature, you might pass the wrong thing to the wrong API- maybe forcing an explicit named interface would be the safer option. More on reddit.com
๐ŸŒ r/Kotlin
10
4
September 30, 2022
Guide to Functional Interfaces in Java
When I don't remember which to use I always refer to this list . I've always felt this functional interface business is just bad design when compared with C# simple Action/Function. Another victim of type erasure. More on reddit.com
๐ŸŒ r/programming
6
18
March 7, 2017
(ELI5) What exactly is the use of "functional Interface"?
Namaste! Thanks for submitting to r/developersIndia . While participating in this thread, please follow the Community Code of Conduct and rules . It's possible your query is not unique, use site:reddit.com/r/developersindia KEYWORDS on search engines to search posts from developersIndia. You can also use reddit search directly. Recent Announcements & Mega-threads Community Roundup: List of must-read posts & interesting discussions that happened in September 2024 Who's looking for work? - Monthly Megathread - October 2024 I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns. More on reddit.com
๐ŸŒ r/developersIndia
1
2
October 23, 2024
What is the purpose of an Interface?
Please ensure that: Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions You include any and all error messages in full - best also formatted as code block You ask clear questions You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions. If any of the above points is not met, your post can and will be removed without further warning. Code is to be formatted as code block (old reddit/markdown editor: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png ) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc. Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit. Code blocks look like this: public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } } You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above. If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures. To potential helpers Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns. More on reddit.com
๐ŸŒ r/learnjava
9
31
February 26, 2023
๐ŸŒ
Oracle
docs.oracle.com โ€บ javase โ€บ 8 โ€บ docs โ€บ api โ€บ java โ€บ lang โ€บ FunctionalInterface.html
FunctionalInterface (Java Platform SE 8 )
July 21, 2026 - However, the compiler will treat any interface meeting the definition of a functional interface as a functional interface regardless of whether or not a FunctionalInterface annotation is present on the interface declaration.
๐ŸŒ
Quora
quora.com โ€บ What-is-the-difference-between-interface-and-functional-interface-in-Java-and-why-is-an-empty-interface-like-a-marker-interface-necessary
What is the difference between interface and functional interface in Java, and why is an empty interface like a marker interface necessary? - Quora
Answer (1 of 4): A regular interface can be created with any number of methods whereas a functional interface can only have one. Regular interfaces have been around since Java one and can be implemented by regular concrete classes. Functional interfaces, introduced in Java 8, are meant to be used...
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ java โ€บ java-functional-interfaces
Java Functional Interfaces - GeeksforGeeks
September 1, 2026 - A functional interface in Java is an interface that has only one abstract method, making it suitable for use with lambda expressions and method references (introduced in Java 8).
๐ŸŒ
Medium
krishankantsinghal.medium.com โ€บ java8-interface-and-functional-interface-e5f9a3dbf136
Java8:- Interface and Functional Interface. | by krishankant singhal | Medium
December 16, 2019 - Java8 is not new now. but it has brought lot of new functionality and changes which has made functional programming very easy. Today we are going to talk about the same. Changes which we are going to discuss about is ... Default method in interface :- Interface is used to define abstract methods which can be implemented by derived classes.
Find elsewhere
๐ŸŒ
DigitalOcean
digitalocean.com โ€บ community โ€บ tutorials โ€บ java-8-functional-interfaces
Java 8 Functional Interfaces | DigitalOcean
Technical tutorials, Q&A, events โ€” This is an inclusive place where developers can find or lend support and discover new ways to contribute to the community.
๐ŸŒ
Javatpoint
javatpoint.com โ€บ java-8-functional-interfaces
Functional Interfaces - javatpoint
Java Java provides a new feature called method reference in Java 8. Method reference is used to refer method of functional interface. It is compact and easy form of lambda expression.
๐ŸŒ
Techwithmaddy
techwithmaddy.com โ€บ java-8-functional-interfaces
What is a functional interface in Java?
October 15, 2023 - A functional interface is an interface that contains only a single abstract method (a method that doesnโ€™t have a body).
๐ŸŒ
Medium
medium.com โ€บ javarevisited โ€บ java-8-interface-changes-functional-interface-interview-questions-67acecda534d
Java 8 Interface changes & Functional Interface โ€” Interview questions | by Daily Debug | Javarevisited | Medium
August 17, 2024 - We donโ€™t need to define the method with an abstract keyword because by default functional interface will allow only one abstract method, if we try to define more than one abstract method in the functional interface we will get a compile time error.
๐ŸŒ
BeginnersBook
beginnersbook.com โ€บ 2017 โ€บ 10 โ€บ java-functional-interfaces
Java Functional Interfaces
An interface with only single abstract method is called functional interface. You can either use the predefined functional interface provided by Java or create your own functional interface and use it. You can check the predefined functional interfaces here: predefined functional interfaces ...
๐ŸŒ
Reddit
reddit.com โ€บ r/kotlin โ€บ what's the difference between using function types and functional interfaces as listeners/callbacks?
r/Kotlin on Reddit: What's the difference between using function types and functional interfaces as listeners/callbacks?
September 30, 2022 -

Is there any difference between setting up a listener/callback with a function type like so:

   class Observed {
       private lateinit var listener: () -> Unit

       fun setListener(listener: () -> Unit) {
           this.listener = listener
       }

       fun doSomething() {
           println("I did something")
           listener()
       }
   }

   fun main() {
       val observed = Observed()
       observed.setListener {
           println("I observed doSomething() inside the Observed class and got called back")
       }
       observed.doSomething()
   }

and setting up a listener/callback with a functional interface like so:

   class Observed {
       private lateinit var listener: Listener

       fun setListener(listener: Listener) {
           this.listener = listener
       }

       fun doSomething() {
           println("I did something")
           listener.onDoSomething()
       }
   }

   fun interface Listener {
       fun onDoSomething()
   }

   fun main() {
       val observed = Observed()
       observed.setListener {
           println("I observed doSomething() inside the Observed class and got called back")
       }
       observed.doSomething()
   }

What are your thoughts and which approach do you prefer most?

Top answer
1 of 5
7
The difference is mostly semantic: what does it "mean" to the person using it? The main, practical, difference is that a functional interface is just a regular object interface that comes with its own factory function- you can make instances by "calling" this auto-generated factory function and passing a lambda. A function type is, well, a function- not an object. The difference is negligible for the downstream implementer of the type. The difference is mostly in how the author intends to use a provided instance of the type. If you do a functional interface, you'll use it with a dot-notation method call, and if you do a function type, you'll just invoke it directly. So, again, it's all about semantics. Do you want to communicate that the thing in question is "an object that does a thing" or do you want to communicate that the thing in question is "an operation"? There is one more difference that's sometimes worth thinking about, which is that since a functional interface is just an interface, it means that a user must pass in something that was explicitly created for the purpose of being used in that way. A function type is obviously satisfied by any function/method that happens to have the same signature. I'm not sure that's ever really a problem, but maybe if you have a bunch of function types and some of them share the same signature, you might pass the wrong thing to the wrong API- maybe forcing an explicit named interface would be the safer option.
2 of 5
2
Function types (lambdas) are anonymous, meaning they don't have a "name" while functional interfaces like SAM have a (hopefully) descriptive name via the class name and the method name. I use all the types mixed, most often I think I have typealias DescribeFnUsage = () -> Unit if the type is part of an API of functionality. Under the hood, JVM treats the types differently. See Function1, Function2 etc for lambdas in Kotlin stdlib source code while get initialised into other types (correct me if I got this wrong, I didn't check my memory serves me right on this)
๐ŸŒ
DZone
dzone.com โ€บ coding โ€บ java โ€บ introduction to functional interfaces โ€“ a concept recreated in java 8
Introduction to Functional Interfaces โ€“ A Concept Recreated in Java 8
March 29, 2013 - But an interface can have one abstract method and any number of default methods and the interface would still be called an functional interface.
๐ŸŒ
Kotlin
kotlinlang.org โ€บ docs โ€บ fun-interfaces.html
Functional (SAM) interfaces | Kotlin Documentation
October 24, 2025 - An interface with only one abstract member function is called a functional interface, or a Single Abstract Method (SAM) interface.
๐ŸŒ
Medium
medium.com โ€บ @kamal81094 โ€บ difference-between-abstract-class-interface-functional-interface-and-marker-interface-47d43052b6f5
Difference Between Abstract Class, Interface, Functional Interface, and Marker Interface | by Ka Ki | Medium
September 22, 2024 - Abstract Class: Use for sharing ... a clear hierarchy. Functional Interface: Use for single-method interfaces that can be implemented with lambda expressions to enable more functional-style programming....
๐ŸŒ
Scaler
scaler.com โ€บ home โ€บ topics โ€บ functional interfaces in java
Functional Interfaces in Java - Scaler Topics
April 20, 2024 - Default methods can be directly ... name. These cannot be overridden by the classes implementing the interface. Functional Interface in Java is also called Single Abstract Method (SAM) interface....
๐ŸŒ
Board Infinity
boardinfinity.com โ€บ blog โ€บ functional-interfaces-in-java
A Definitive Guide to Functional Interfaces | Board Infinity
July 7, 2023 - When there is more than one functional interface, it is not get called a functional interface. Interfaces without functionalities get referred to as non-functional interfaces. There is no such need for the @FunctionalInterface annotation as it is voluntary only.
๐ŸŒ
Java Guides
javaguides.net โ€บ 2023 โ€บ 11 โ€บ marker-interface-vs-functional.html
Marker Interface vs Functional Interface in Java
March 19, 2024 - A marker interface is an empty ... A functional interface, introduced in Java 8, is an interface that contains exactly one abstract method and is used as the basis for lambda expressions in functional programming...