Scala Byte ==(x: Double): Boolean
在Scala中,Byte是一个8位有符号整数(与Java的byte原始类型相同)。方法 ==(x:Double)
方法用于返回true,如果此值等于x,则返回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).==(64:Double)
// Displays output
println(result)
}
}
输出:
true
示例#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)
}
}
输出:
false
更多Scala相关文章,请阅读:Scala 教程