Open In App

Scala Int min() method with example

Last Updated : 23 Feb, 2021
Improve
Improve
Like Article
Like
Save
Share
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


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads