📜  带有示例的 Scala Short !=(x: Byte) 方法

📅  最后修改于: 2022-05-13 01:54:59.824000             🧑  作者: Mango

带有示例的 Scala Short !=(x: Byte) 方法

!=(x: Byte)方法用于检查声明的 Short 值是否不等于“x”。 'x' 是字节类型。

示例:1#

// Scala program of !=(x: Byte)
// method
  
// Creating object
object GfG
{ 
  
    // Main method
    def main(args:Array[String])
    {
      
        // Applying !=(x: Byte) method 
        val result = (-1000).!=(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 = (1000).!=(-125)
          
        // Displays output
        println(result)
      
    }
} 
输出:
true