paint-brush
The Interconnection of Functional Interfaces in Java and Kotlinby@amrdeveloper
174 reads

The Interconnection of Functional Interfaces in Java and Kotlin

by Amr Hesham2mMarch 14th, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

SAM stands for Single Abstract Method interface and it’s called also Functional interface. Functional interface is an interface with only one non-default method and any number of default methods. In Kotlin you can use Java or Kotlin Functional interfaces as a Lambda expression for example. The same syntax will work on Kotlin also if your functional interface is written in Java like OnClickListener. The syntax is not an extension but SAM conversion, but what does SAM stand for? You can use the same syntax to call your custom listener like setOnClick listener.

Company Mentioned

Mention Thumbnail
featured image - The Interconnection of Functional Interfaces in Java and Kotlin
Amr Hesham HackerNoon profile picture
Amr Hesham

Amr Hesham

@amrdeveloper

Software Engineer interested in Android Development and Programming language design

Learn More
LEARN MORE ABOUT @AMRDEVELOPER'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Amr Hesham HackerNoon profile picture
Amr Hesham@amrdeveloper
Software Engineer interested in Android Development and Programming language design

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Buzzsumo
Newsbreak
Sumi
Coffee-web