Open In App

Scala Int min() method with example

Last Updated : 23 Feb, 2021
Comments
Improve
Suggest changes
Like Article
Like
Report

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
// 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
// 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

Next Article
Article Tags :

Similar Reads