Scala Char !=(x: Byte)方法及示例
!=(x: Byte)方法用于检查指定字符值是否不等于’x’,’x’的类型为Byte。
方法定义:def !=(x: Byte): Boolean
返回类型:如果指定字符值不等于’x’则返回true,否则返回false。
示例1:
// Scala program of !=(x: Byte)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying !=(x: Byte) method
val result = 'E'.!=(125)
// Displays output
println(result)
}
}
true
示例2:
// Scala program of !=(x: Byte)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying !=(x: Byte) method
val result = 'B'.!=(-125)
// Displays output
println(result)
}
}
true
更多Scala相关文章,请阅读:Scala 教程
极客教程