multiplyExact(x: Int, y: Int)
is a function in the math package of Scala. The function returns the product of the numbers passed in as arguments.
def multiplyExact(x: Int, y: Int) : Int
The function takes two parameters:
1.x
2.y
The parameters are of type Int
.
The function returns *.
The function throws ArithmeticException if
Int
is overflowed by the return value.
object MainObject {def main(args: Array[String]) {var x : Int = 31;var y : Int = 11;println("Math.multiplyExact(x, y) = " + Math.multiplyExact(x, y));}}