Open In App

Scala Char min() method with example

Last Updated : 03 Nov, 2019
Summarize
Comments
Improve
Suggest changes
Share
Like Article
Like
Report
The min() method is utilized to find the minimum of the two specified characters.
Method Definition: def min(that: Char): Char Return Type: It returns the character with the minimum value.
Example: 1# Scala
// Scala program of min()
// method

// Creating object
object GfG
{ 

    // Main method
    def main(args:Array[String])
    {
    
        // Applying min() method 
        val result = ('F').min('A')
        
        // Displays output
        println(result)
    
    }
} 
Output:
A
Example: 2# Scala
// Scala program of min()
// method

// Creating object
object GfG
{ 

    // Main method
    def main(args:Array[String])
    {
    
        // Applying min() method
        val result = ('a').min('A')
        
        // Displays output
        println(result)
        
    }
} 
Output:
A

Next Article
Article Tags :

Similar Reads