#73 Functional Interface New in Java

Check out our courses: Java Spring Boot AI Live Course: https://go.telusko.com/JavaSpringBootAI Coupon: TELUSKO20 (20% Discount) AI Powered DevOps with A...

#73 Functional Interface New in Java
Telusko
180.1K views β€’ Jan 19, 2023
#73 Functional Interface New in Java

About this video

Check out our courses:

Java Spring Boot AI Live Course: https://go.telusko.com/JavaSpringBootAI
Coupon: TELUSKO20 (20% Discount)

AI Powered DevOps with AWS - Live Course :- https://go.telusko.com/AIDevOps-AWS
Coupon: TELUSKO20 (20% Discount)

Master Java Spring Development : https://go.telusko.com/masterjava
Coupon: TELUSKO20 (20% Discount)

For More Queries WhatsApp or Call on : +919008963671

website : https://courses.telusko.com/


Udemy Courses:

Spring: https://go.telusko.com/udemyteluskospring
Java:- https://go.telusko.com/udemyteluskojava
Java Spring:- https://go.telusko.com/Udemyjavaspring
Java For Programmers:- https://go.telusko.com/javaProgrammers
Python : https://go.telusko.com/udemyteluskopython
Git : https://go.telusko.com/udemyteluskogit
Docker : https://go.telusko.com/udemyteluskodocker

Instagram : https://www.instagram.com/navinreddyofficial/
Linkedin : https://in.linkedin.com/in/navinreddy20
TELUSKO Android App : https://go.telusko.com/TELUSKOAPP
TELUSKO IOS App : https://apple.co/3SsgmU2
Discord : https://discord.gg/D8hWe9BqfF

In this lecture, we are discussing functional interface:
#1 what is functional Interface?
--functional interface is an interface with only one abstract method

#2
The properties of a functional interface in Java are as follows:

Single Abstract Method: A functional interface has only one abstract method.
This method is the signature of the interface and defines the behaviour that will be implemented in the lambda expression or with simple class.

Functional Method: The abstract method of a functional interface is called the functional method.
It is the method that provides the functional behaviour of the interface.

@FunctionalInterface Annotation: A functional interface is annotated with the @FunctionalInterface annotation.
This annotation is optional, but it provides a compile-time check that the interface has only one abstract method.

Compatible with Lambda Expressions: A functional interface is compatible with lambda expressions.
A lambda expression is a concise way of implementing the functional method of a functional interface.
(This will discuss in next lecture of lambda expression).

Functional interfaces are a key component of functional programming in Java,
and they are used extensively in the Java 8 Streams API and other Java libraries.


#3 Example
class Main{
public static void main(String []args){
A obj = new B();
obj.show();

//another way to implement functional interface
A obj1 = new A(){
@Override
public void show(){
System.out.println("Hello");
}
};
obj1.show();

}
}

//one way to implement functional interface
class B implements A{
@Override
public void show(){
System.out.println("Hello");
}
}

//specify it is functional interface
@FunctionalInterface //we use this annotation to specify it is functional interface
interface A{
void show();
//void run(); //this will give error as it is a functional interface you cannot write two abstract method in this
}

Github repo : https://github.com/navinreddy20/Javacode.git

More Learning :

Java :- https://bit.ly/3x6rr0N
Python :- https://bit.ly/3GRc7JX
Django :- https://bit.ly/3MmoJK6

JavaScript :- https://bit.ly/3tiAlHo
Node JS :- https://bit.ly/3GT4liq

Rest Api :-https://bit.ly/3MjhZwt
Servlet :- https://bit.ly/3Q7eA7k
Spring Framework :- https://bit.ly/3xi7buh
Design Patterns in Java :- https://bit.ly/3MocXiq
Docker :- https://bit.ly/3xjWzLA

Blockchain Tutorial :- https://bit.ly/3NSbOkc
Corda Tutorial:- https://bit.ly/3thbUKa
Hyperledger Fabric :- https://bit.ly/38RZCRB

NoSQL Tutorial :- https://bit.ly/3aJpRuc
Mysql Tutorial :- https://bit.ly/3thpr4L

Data Structures using Java :- https://bit.ly/3MuJa7S
Git Tutorial :- https://bit.ly/3NXyCPu

Donation:
PayPal Id : navinreddy20
https://www.telusko.com

Tags and Topics

Browse our collection to discover more content in these categories.

Video Information

Views

180.1K

Likes

1.9K

Duration

3:34

Published

Jan 19, 2023

User Reviews

4.5
(36)
Rate:

Related Trending Topics

LIVE TRENDS

Related trending topics. Click any trend to explore more videos.