Scala procedure and function differences
A Function, that doesn’t return anything can return a Unit that is comparable to void in Java and shows that function doesn’t return anything back. The functions which don’t return anything in Scala, they are procedures.
use case 1:
scala> def rect_area(length:Float, breadth:Float) {val area = length*breadth; println(area)}
use case 2:
scala> def circle_area(radius:Float) {val area = 3.14*radius*radius; println(area)}
use case 3: