Scala Char isWhole() method with example
Last Updated :
02 Nov, 2019
The isWhole(() method is utilized to check if the stated character has decimal component or not.
Method Definition: def isWhole: Boolean
Return Type: It returns true if the stated character is a whole number else it returns false.
Example: 1#
object GfG
{
def main(args : Array[String])
{
val result = ( 'A' ).isWhole
println(result)
}
}
|
Example: 2#
object GfG
{
def main(args : Array[String])
{
val result = ( '0' ).isWhole
println(result)
}
}
|
Share your thoughts in the comments
Please Login to comment...