Scala Short max() method with example
Last Updated :
11 Nov, 2019
The max() method is utilized to find the maximum of the two specified Short types.
Method Definition: def max(that: Short): Short
Return Type: It returns the number of type Short with the maximum value.
Example: 1#
object GfG
{
def main(args : Array[String])
{
val result = (- 1000 ).max( 999 )
println(result)
}
}
|
Example: 2#
object GfG
{
def main(args : Array[String])
{
val result = ( 990 ).max( 1000 )
println(result)
}
}
|
Share your thoughts in the comments
Please Login to comment...