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