带有示例的 Scala Char <(x: Int) 方法
<(x: Int)方法用于查找所述字符值是否小于'x'。并且“x”的类型必须是整数。
Method Definition: def <(x: Int): Boolean
Return Type: It returns true if the stated character value is less than “x” else it returns false.
示例:1#
// Scala program of <(x: Int)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying <(x: Int) method
val result = 'D'.<(56)
// Displays output
println(result)
}
}
输出:
false
示例:2#
// Scala program of <(x: Int)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying <(x: Int) method
val result = 'D'.<(74)
// Displays output
println(result)
}
}
输出:
true