📌  相关文章
📜  Scala Char |(x: Short) 方法示例

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

Scala Char |(x: Short) 方法示例

|(x: Short)方法用于查找所述字符值的按位或,并在必须为 Short 类型的参数列表中给出“x”。

示例:1#

// Scala program of |(x: Short)
// method
  
// Creating object
object GfG
{ 
  
    // Main method
    def main(args:Array[String])
    {
      
        // Applying |(x: Short) method 
        val result = 'B'.|(10000)
          
        // Displays output
        println(result)
      
    }
} 
输出:
10066

示例:2#

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