Scala Int +(x: Int) method with example
Last Updated :
17 Feb, 2021
The +(x: Int) method is utilized to return the sum of the specified first int value and second int value.
Method Definition: (Int_Value).+(Int_Value)
Return Type: It returns the sum of the specified first int value and second int value.
Example #1:
Scala
object GfG
{
def main(args : Array[String])
{
val result = ( 100 ).+( 60 )
println(result)
}
}
|
Example #2:
Scala
object GfG
{
def main(args : Array[String])
{
val result = ( 10 ).+( 16 )
println(result)
}
}
|
Share your thoughts in the comments
Please Login to comment...