Scala Int max() method with example
Last Updated :
30 Jan, 2020
The max() method is utilized to return the maximum value of the two specified int numbers.
Method Definition: (First_Number).max(Second_Number)
Return Type: It returns true the maximum value of the two specified int numbers.
Example #1:
object GfG
{
def main(args : Array[String])
{
val result = ( 5 ).max( 9 )
println(result)
}
}
|
Example #2:
object GfG
{
def main(args : Array[String])
{
val result = ( 5 ).max( 5 )
println(result)
}
}
|
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...