I like using Lambda Expression because it makes my code cleaner. However, I realized I didn’t fully understand why and how Lambda Expression works. In this post, I’d like to share what I learned about Anonymous Class, Functional Interface, and Lambda Expression.
Suppose you have an interface Animal.
Let’s declare a class Pig that implements the interface Animal.
We can now instantiate this class with the new keyword.
Animal pig = new Pig();
This was wordy. What if there’s a much shorter way? …
In my previous post, I discussed what Functional Programming is and the benefits of adopting Functional Programming in Object-Oriented languages. Now, let’s get our hands dirty and apply Functional Programming in Java.
Before I begin, I want to clarify what I mean by adopting Functional Programming. Some people can say that they’ve adopted Functional Programming by simply implementing first-class functions or pure functions. However, I think it’s only half correct. Adopting Functional Programming is not only using the techniques of Functional Programming but understanding the conceptual difference between Object-Oriented Programming and start programming in a functional way. …
Please read my previous post before you continue reading.
In my previous post, I showed how using Functional Interface and Lambda Expression adds syntactic sugar to the code. It’s a good enough reason why we should consider using those. However, is that all they offer? There must be more reasons why Java introduced these concepts.
To get straight to the answer, Functional Interface and Lambda Expression allow us to adopt Functional Programming in Java. Wait a minute. Wasn’t Java an Object-Oriented programming language? …
This post will guide you on how to set up, run, and deploy Flutter web app.
Want to read this story later? Save it in Journal.
Requirement: Flutter SDK, Chrome…
Intern @ PurpleLabs | CS @ Mount Holyoke College ’23