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