Scala Int toString() method with example
The toString() method is utilized to return the string representation of the specified value.
Method Definition: def toString(): String
Return Type: It returns the string representation of the specified value.
Example #1:
object GfG
{
def main(args : Array[String])
{
val result = ( 65 ).toString
println(result)
}
}
|
Example #2:
object GfG
{
def main(args : Array[String])
{
val result = ( 1515 ).toString
println(result)
}
}
|
Last Updated :
04 Feb, 2020
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...