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