Scala Int isValidInt() method with example
Last Updated :
23 Feb, 2021
The isValidInt() method is utilized to return true if the specified int number is either zero or lies within the range of scala.int MinValue and MaxValue; otherwise returns false.
Method Definition: (Int_Number).isValidIntReturn
Type: It returns true if the specified number is either zero or lies within
the range of scala.int MinValue and MaxValue; otherwise returns false.
Example 1:
Scala
object GfG
{
def main(args : Array[String])
{
val result = ( 0 ).isValidInt
println(result)
}
}
|
Example 2:
Scala
object GfG
{
def main(args : Array[String])
{
val result = ( 5.9 ).isValidInt
println(result)
}
}
|
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...