Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Scala Int min() method with example

  • Last Updated : 23 Feb, 2021

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



My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!