Latest Java Features from a Scala Dev Perspective - Part 2: Lambda Expressions

I started my career as a Java developer back in 2011. I developed most of my code in the 1.7 version of Java. Around 2014, I switched to full-time Scala and have not programmed in Java.

Java was a slow-moving language that had started lagging behind the other languages. Scala kind of filled that gap of modern language on a JVM. But in the last few years, it has changed. There is a new version of Java every 6 months and it has been getting new features at a very rapid pace. So I thought it will be interesting to go back to Java now and see how it has evolved compared to Java 7.

So in this series of posts, I will be talking about new features of Java from a Scala developer’s point of view. I will be using?Java 17, the latest LTS version, for these examples.

This is the second post in the series where I will be talking about lambda expressions. You can find all the posts in the series?here.

Function Passing in Java 7 using Anonymous Classes

Many developers think that before Java 8 they could not implement function passing in Java. But it’s not true. Using anonymous classes, we can mimic the function passing in Java 7.

Below are the steps involved in the same.

要查看或添加评论,请登录

madhukara phatak的更多文章

社区洞察

其他会员也浏览了