Java Lambda Expressions #2 - Functional Interfaces

preview_player
Показать описание
In my first video about Java lambda expressions I said that a Java lambda expression can only implement single method interfaces, meaning interfaces with a single method in. However, that is not entirely correct.

A Java lambda expression can implement interfaces which have a single unimplemented method (abstract method), but the interface can have as many default and static methods as you like. This video shows examples of that.

Here is a link to a full article about Java lambda expressions:

Here is my YouTube playlist about Java lambda expressions:

Рекомендации по теме
Комментарии
Автор

You've a real knack for teaching and explaining things clearly and quickly. Thank you for these videos.

TheShepTV
Автор

It sounds like Bjarne Stoustrop teaching Java. Love it!

josh_rdgrs
Автор

Thank you for making it possible to look cool in front of my Java Teacher :) Great way of explaining, understood everything.

boristhebear
Автор

Great Lessons! Appreciate your videos!

benneal
Автор

Thanks buddy. I am studying for OCA. I am learning from your helpful videos.

mdm
Автор

Thank you very much for your explanation. It helped me a lot!

beatakazmierczak
Автор

Hi there, what if we had 2 abstract methods in our interface? Great video btw thank you!

randb
Автор

This is not a question about the lambda expressions but the interface you defined at the beginning of the video (MyInterface). Why can you define a static method with implementation inside an interface? as far as I know that cannot be done.

angelixuscraft
Автор

why use a static method in interface over regular ones? What would be a advantage? As far as I know static methods are preffered if we want to performs actions that are irrelevent to the current instance of the object. like adding two int values or etc. Yet when using lambdas we can achive the same goal via redifining bodies of abstracts methods in a interface. What am I missing?

utkuceylan
Автор

Why should you not through errors from class?

qaipak