📜  Scala Char unary_~() 方法与示例

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

Scala Char unary_~() 方法与示例

unary_~()方法用于查找所述字符的按位否定值。

示例:1#

// Scala program of unary_~()
// method
  
// Creating object
object GfG
{ 
  
    // Main method
    def main(args:Array[String])
    {
      
        // Applying unary_~ method
        val result = 'A'.unary_~
          
        // Displays output
        println(result)
      
    }
} 
输出:
-66

示例:2#

// Scala program of unary_~()
// method
  
// Creating object
object GfG
{ 
  
    // Main method
    def main(args:Array[String])
    {
      
        // Applying unary_~ method
        val result = 'B'.unary_~
          
        // Displays output
        println(result)
      
    }
} 
输出:
-67