带有示例的 Scala Char isWhole() 方法
isWhole(()方法用于检查所述字符是否具有小数部分。
Method Definition: def isWhole: Boolean
Return Type: It returns true if the stated character is a whole number else it returns false.
示例:1#
// Scala program of isWhole()
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying isWhole() method
val result = ('A').isWhole
// Displays output
println(result)
}
}
输出:
true
示例:2#
// Scala program of isWhole()
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying isWhole() method
val result = ('0').isWhole
// Displays output
println(result)
}
}
输出:
true