Hey,
- Here is the example of which will return the maximum value from a set:
scala> s.max
res8: Int = 4
- Here is the example of which will return the minimum value from a set:
scala> s.min
res9: Int = 1
Hope this helps!
If you need to know more about Scala, join Scala course today and become the expert.
Thanks!!