Scala Char max() method with example
Last Updated :
03 Nov, 2019
The max() method is utilized to find the maximum of the two specified characters.
Method Definition: def max(that: Char): Char
Return Type: It returns the character with the maximum value.
Example: 1#
object GfG
{
def main(args : Array[String])
{
val result = ( 'F' ).max( 'A' )
println(result)
}
}
|
Example: 2#
object GfG
{
def main(args : Array[String])
{
val result = ( 'a' ).max( 'A' )
println(result)
}
}
|
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...