Lambda Expressions in Java 8 (Part 1)

Why Lambdas?

Functional Programming and Object Oriented Programming

package lambdatutorial;/**
*
* @author Kasun Dissanayake
*/
public interface Print {
public void perform();

}
package lambdatutorial;/**
*
* @author Kasun Dissanayake
*/
public class PrintPerform implements Print {
@Override
public void perform() {
System.out.println("Welcome...");
}

}
package lambdatutorial;/**
*
* @author Kasun Dissanayake
*/
public class LambdaTutorial {
public void print(Print print){
print.perform();
}
public static void main(String[] args) {

LambdaTutorial lambdaTutorial = new LambdaTutorial();
PrintPerform printperform = new PrintPerform();
lambdaTutorial.print(printperform);


}

}

--

--

--

Software Engineer at IFS R & D International (Pvt) Ltd || Former Software Engineer at Pearson Lanka || Former Associate Software Engineer at hSenid Mobile

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Replication Controller Vs Replica Set

Running Netflix Conductor 3 in Docker Using Elasticsearch 7 and PostgreSQL

My Take on Rancher, First Sight

Deploy shlink to K8s

Connecting the Dots with Terraform(IaC)!!

How to hire and build a software development team!

Fun with HTML Canvas: Let’s make Lava Lamp Plasma

What is Web Hosting? — Ultimate Guide to Web Hosting

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Kasun Dissanayake

Kasun Dissanayake

Software Engineer at IFS R & D International (Pvt) Ltd || Former Software Engineer at Pearson Lanka || Former Associate Software Engineer at hSenid Mobile

More from Medium

Comparing Arrays.sort() and Collections.sort() in Java

Java Lambda Expressions

Java OOPS Concepts

OOPs in Java