Scala Int self() method with example
Last Updated :
23 Feb, 2021
The self() method is utilized to return the same value which has been specified.
Method Definition: (Value).selfReturn
Type: It returns true the same value which has been specified.
Example 1:
Scala
object GfG
{
def main(args : Array[String])
{
val result = ( 5 ).self
println(result)
}
}
|
Example 2:
Scala
object GfG
{
def main(args : Array[String])
{
val result = ( 10 ).self
println(result)
}
}
|
Share your thoughts in the comments
Please Login to comment...