The min() method is utilized to return the minimum value of the two specified int numbers.
Method Definition: (First_Number).min(Second_Number)Return Type: It returns true the minimum value of the two specified int numbers.
Example 1:
// Scala program of Int min()
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying min method
val result = (5).min(9)
// Displays output
println(result)
}
}
Output:
5
Example 2:
// Scala program of Int min()
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying min method
val result = (5).min(5)
// Displays output
println(result)
}
}
Output:
5