Open In App

Scala Char min() method with example

Last Updated : 03 Nov, 2019
Improve
Improve
Like Article
Like
Save
Share
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 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 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


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads