class ExceptionExample{ def divide(a:Int, b:Int) = { a/b // Exception occurred here println("rest of the code is executing...") } } object MainObject{ def main(args:Array[String]){ var e = new ExceptionExample() e.divide(100,0) } }
java.lang.ArithmeticException: / by zero