Implicit Classes, Scala.
the implicit class that does not extend AnyVal is treated as a normal class and can handle more complex logic. Here’s one more example. Let’s say we want to add a method to the Int type that calculates the factorial of a number. We can define an implicit class that takes an Int value and adds this