Find limit of recursion is part of Short Circuit's Console Program Basics selection.
Task

Find the limit of recursion.




def recurseTest(i:Int):Unit={
   try{
      recurseTest(i+1)
   } catch { case e:java.lang.StackOverflowError => 
      println("Recursion depth on this system is " + i + ".")
   }
}
recurseTest(0)