When you write :

TestInterface i = () -> System.out.println("Hans");

You give an implementation to the void hans() method of the TestInterface.

If you could assign a lambda expression to an interface having more than one abstract method (i.e. a non functional interface), the lambda expression could only implement one of the methods, leaving the other methods unimplemented.

You can't solve it by assigning two lambda expressions having different signatures to the same variable (Just like you can't assign references of two objects to a single variable and expect that variable to refer to both objects at once).

Answer from Eran on Stack Overflow
🌐
Baeldung
baeldung.com › home › java › core java › lambda expressions and functional interfaces: tips and best practices
Lambda Expressions and Functional Interfaces: Tips and Best Practices | Baeldung
December 16, 2023 - Elegant Sort in Java 8 - Lambda Expressions go right past syntactic sugar and bring powerful functional semantics into Java. ... Functional interfaces, which are gathered in the java.util.function package, satisfy most developers’ needs in providing target types for lambda expressions and method references.
🌐
GeeksforGeeks
geeksforgeeks.org › java › java-functional-interfaces
Java Functional Interfaces - GeeksforGeeks
1 month ago - 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).
Discussions

java - Why do I need a functional Interface to work with lambdas? - Stack Overflow
I think this question is already somewhere out there, but I wasn't able to find it. I don't understand, why it's necessary to have a functional interface to work with lambdas. Consider the following More on stackoverflow.com
🌐 stackoverflow.com
Java 8 Features - Functional Interface and Lambda Expression
Are we in the year 2014? More on reddit.com
🌐 r/programming
1
0
January 9, 2026
Java: lambda functions vs functional interfaces. Succinctness vs readability?
In Java are lambdas a short form of using anonymous functions, both requires that a functional interface has been defined. Not sure what you referre to with "witch method is overwritten", the lambda is passed as an object (with only one specific method) to the recipient that may call this "only" method. There are pros and cons with lambdas, as with any other idioms, use it wisely. More on reddit.com
🌐 r/learnprogramming
4
0
February 3, 2023
Handling Checked Exceptions in Java Functional Interfaces (Lambdas)
Usually I either have ugly inline try catch blocks, a private method doing the same, or I make sure the method I call only uses unchecked exceptions - but it’s not ideal and and unfortunately a posterbook example of Java's design. More on reddit.com
🌐 r/java
77
39
September 23, 2024
🌐
Medium
medium.com › @lakshyachampion › mastering-functional-interfaces-and-lambda-expressions-in-java-c02d8aaff5b2
Mastering Functional Interfaces and Lambda Expressions in Java | by Lakshya Agarwal | Medium
January 17, 2024 - Java provides several built-in ... lambda expressions were introduced in Java 8 as a way to provide concise syntax for expressing instances of single-method interfaces (functional interfaces)....
🌐
Oracle
docs.oracle.com › javase › tutorial › java › javaOO › lambdaexpressions.html
Lambda Expressions (The Java™ Tutorials > Learning the Java Language > Classes and Objects)
Because a functional interface contains only one abstract method, you can omit the name of that method when you implement it. To do this, instead of using an anonymous class expression, you use a lambda expression, which is highlighted in the following method invocation:
🌐
Baeldung
baeldung.com › home › java › core java › functional interfaces in java
Functional Interfaces in Java | Baeldung
March 26, 2025 - We can observe this by looking at the Function’s documentation. The most simple and general case of a lambda is a functional interface with a method that receives one value and returns another.
🌐
Medium
medium.com › @kumar.atul.2122 › java-8-lambda-functional-interface-method-reference-stream-api-and-optional-class-f685143635fb
Java 8: lambda, functional interface, method reference, Stream API and Optional class | by Atul Kumar | Medium
February 19, 2023 - In this example, we pass a lambda ... integers in descending order. In Java, a functional interface is an interface that contains exactly one abstract method....
Find elsewhere
🌐
Stack Abuse
stackabuse.com › guide-to-functional-interfaces-and-lambda-expressions-in-java
Guide to Functional Interfaces and Lambda Expressions in Java
March 29, 2023 - Since a regular interface can have many abstract methods (and since there is no indication that this interface is not like any other), the compiler will blame the lambda expression for it tries to bind to a non-functional interface. To avoid this, Java provides a way to mark the interfaces that serve lambda expressions, explicitly:
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › util › function › package-summary.html
java.util.function (Java Platform SE 8 )
July 21, 2026 - Functional interfaces provide target types for lambda expressions and method references. Each functional interface has a single abstract method, called the functional method for that functional interface, to which the lambda expression's parameter and return types are matched or adapted.
🌐
GeeksforGeeks
geeksforgeeks.org › java › lambda-expressions-java-8
Java Lambda Expressions - GeeksforGeeks
A functional interface contains exactly one abstract method, but it can have multiple default and static methods. It is mainly used with lambda expressions and method references to enable functional programming in Java.
Published: August 29, 2026
🌐
Medium
medium.com › swlh › functional-interfaces-and-lambda-expressions-java-8-series-part-1-4cc60f2542ba
Functional Interfaces and Lambda Expressions — Java 8 Series Part 1 | by Pooja Kulkarni | The Startup | Medium
August 10, 2020 - Why was this new concept introduced? A functional interface eliminates the need of writing anonymous classes and helps us write lambda expressions which will be shortly explained. How to define a functional interface is Java 8?
🌐
Baeldung
baeldung.com › home › lesson 2: functional interfaces and lambdas in java
Lesson 2: Functional Interfaces and Lambdas in Java - Baeldung Membership
October 14, 2025 - A functional interface is any interface that defines a single abstract method. These interfaces are designed to represent single units of behavior and are the target type for lambda expressions and method references, which we’ll introduce later in this lesson.
🌐
DZone
dzone.com › coding › java › functional interface and lambda expressions in java 8
Functional Interface and Lambda Expressions in Java 8
July 23, 2018 - Examples of a functional interface ... methods but only one abstract method. Lambda expressions are introduced in Java 8, and they can represent the instance of a functional interface....
🌐
Eherrera
eherrera.net › ocpj8-notes › 04-lambda-built-in-functional-interfaces
Java SE 8 Programmer II - Lambda Built-in Functional Interfaces
- Use the built-in interfaces included ... - Develop code that uses the UnaryOperator interface · Functional interfaces provide target types for lambda expressions and method references....
🌐
Sunflower Lab
thesunflowerlab.com › home › java lambda expressions
Java Lambda Expression - How To Implement Functional Interface
September 4, 2024 - Lambda expression is one of the new features of Java 8. It is mainly used to implement functional interfaces.
🌐
Great Learning
mygreatlearning.com › blog › it/software development › streamlining code with functional interfaces and lambda expressions in java
Streamlining Code with Functional Interfaces and Lambda Expressions in Java
September 3, 2024 - The purpose of functional interfaces is to provide a contract for implementing specific behavior, allowing developers to write more flexible and concise code. Lambda expressions, introduced in Java 8, are a powerful feature that allows the implementation of functional interfaces in a more concise and expressive manner...
🌐
Medium
shiharadilshan.medium.com › java-lambda-expressions-and-functional-interfaces-c6ac060e19d9
Java Lambda expressions and Functional interfaces. | by Shihara Dilshan | Medium
July 28, 2023 - Functional interface is just a interface in java but only have 1 abstract method. Interfaces can have many abstract methods but in functional interface there is only one. How a functional interface is different than a normal interface?
🌐
DataFlair
data-flair.training › blogs › java-functional-interface
Java Functional Interface | Lambda Expression in Java - DataFlair
May 22, 2026 - Java functional interface is an interface that has one abstract method, and it can display only one functionality. Lambda expression in Java is used to represent a functional interface or an interface since Java 8.
🌐
Jenkov
jenkov.com › tutorials › java-functional-programming › functional-interfaces.html
Java Functional Interfaces
March 8, 2021 - A Java functional interface can be implemented by a Java Lambda Expression.
🌐
SWTestAcademy
swtestacademy.com › home › lambda functions in java and custom functional interfaces
Lambda Functions in Java and Custom Functional Interfaces
October 10, 2021 - One of the powerful features of functional programming is we can define lambda functions as parameters and send them to the functions as arguments. I want to show this with an example. Let’s assume we have PlayService and it has a run method that we can implement. //SAM: Single Abstract Method (Functional Interface annotation dictates that this interface has single abstract method.)