What is the output of the following code ?

Note: Assume necessary imports have been done

object DemoApp extends App {
def findDivision(number: Int) =
Future {
5 / number
}
val response = findDivision(0)
response.onSuccess { case value => print(value) } //Line1
Thread.sleep(5)
}

Nothing will be printed on screen

java.lang.ArithmeticException: / by zero

Failure("java.lang.ArithmeticException: / by zero")

Success("java.lang.ArithmeticException: / by zero")

Verified Answer
Correct Option - a

To get all Infosys Certified Scala Programmer Exam questions Join Telegram Group https://rebrand.ly/lex-telegram-236dee

Telegram