Author: Shubham Shrivastava

Scala Trait

Reading Time: 2 minutes Introduction: Scala trait is like an interface with partial implementation. Scala trait is a collection of abstract and non-abstract methods. You can create traits that have all abstract methods or some abstract methods and some non-abstract methods. Any variable declare using the val or var keyword in a trait gets implement internally in the class that implements the trait. A variable declared with val or Continue Reading

Lambda Expressions in Scala

Reading Time: 3 minutes Introduction : Lambda expression is an anonymous function that uses a variable instead of a value. It allows us to create functions that are easily reusable. Syntax: Example: val square = (x:Int) => x * x How to write Lambda Expression in Scala : Lambda expressions in Scala the syntax for these uses a symbol it’s an equals and a greater than and we refer Continue Reading