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