Scala Int isValidByte() method with example
Last Updated :
30 Jan, 2020
The isValidByte() method is utilized to return true if the specified int number is either zero or lies within the range of scala.Byte MinValue and MaxValue; otherwise returns false.
Method Definition: (Int_Number).isValidByte
Return Type: It returns true if the specified int number is either zero or lies within the range of scala.Byte MinValue and MaxValue; otherwise returns false.
Example #1:
object GfG
{
def main(args : Array[String])
{
val result = ( 5 ).isValidByte
println(result)
}
}
|
Example #2:
object GfG
{
def main(args : Array[String])
{
val result = ( 5.9 ).isValidByte
println(result)
}
}
|
Share your thoughts in the comments
Please Login to comment...