Scala Int toLong() method with example
Last Updated :
04 Feb, 2020
The toLong() method is utilized to convert the specified int number into float long type value.
Method Definition: (Number).toLong
Return Type: It returns the converted long datatype value.
Example #1:
object GfG
{
def main(args : Array[String])
{
val result = ( 1 ).toLong
println(result)
}
}
|
Example #2:
object GfG
{
def main(args : Array[String])
{
val result = ( 12 ).toLong
println(result)
}
}
|
Share your thoughts in the comments
Please Login to comment...