Scala Int -(x: Int) method with example
The -(x: Int) method is utilized to return the difference of the specified first int value and second int value.
Method Definition: (First_Int_Value).-(Second_Int_Value)
Return Type: It returns the difference of the specified first int value and second int value.
Example #1:
object GfG
{
def main(args : Array[String])
{
val result = ( 100 ).-( 50 )
println(result)
}
}
|
Example #2:
object GfG
{
def main(args : Array[String])
{
val result = ( 10 ).-( 5 )
println(result)
}
}
|
Last Updated :
21 Nov, 2019
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...