Scala Byte <(x: Double): Boolean
在Scala中,Byte是8位有符号整数(相当于Java的byte原始类型)。<(x:Double)方法用于如果此值小于x,则返回true,否则返回false。
方法定义: Byte <(x: Double):Boolean
返回类型: 如果此值小于x,则返回true,否则返回false。
示例#1:
// Scala program of Byte <(x: Double)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying Byte <(x: Double) function
val result = (64.toByte).<(12:Double)
// Displays output
println(result)
}
}
输出:
false
示例#2:
// Scala program of Byte <(x: Double)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying Byte <(x: Double) function
val result = (25.toByte).<(111:Double)
// Displays output
println(result)
}
}
输出:
true
更多Scala相关文章,请阅读:Scala 教程