📜  Scala Float !=(x: Char) 方法与示例

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

Scala Float !=(x: Char) 方法与示例

!=(x: Char)方法用于检查给定的 Float 和 Char 值是否彼此相等。

示例 #1:

Scala
// Scala program of Float !=(x: Char)
// method
 
// Creating object
object GfG
{
 
    // Main method
    def main(args:Array[String])
    {
     
        // Applying !=(x: Char) function
        val result = (65.0).!=('A')
         
        // Displays output
        println(result)
     
    }
}


Scala
// Scala program of Float !=(x: Char)
// method
 
// Creating object
object GfG
{
 
    // Main method
    def main(args:Array[String])
    {
     
        // Applying !=(x: Char) function
        val result = (65.0).!=('C')
         
        // Displays output
        println(result)
     
    }
}


输出:
false

示例 #2:

斯卡拉

// Scala program of Float !=(x: Char)
// method
 
// Creating object
object GfG
{
 
    // Main method
    def main(args:Array[String])
    {
     
        // Applying !=(x: Char) function
        val result = (65.0).!=('C')
         
        // Displays output
        println(result)
     
    }
}
输出:
true