Loops in Scala (Imperative & Tail Recursive)

The following are different ways of implementing simple loops in Scala While loop The Scala while loop executes a certain block of code, as long as a certain condition is true. while(someObject.hasNext()) process(someObject.next()); Do While Loop The Scala  do while loop is similar to the while loop except the condition is executed after the loop body. This means that the loop body… Continue reading Loops in Scala (Imperative & Tail Recursive)