Scala Int ^(x: Short) 方法及示例

Scala Int ^(x: Short) 方法及示例

^ (x: Short)方法被用来返回 int 和指定的 short 值按位异或操作结果的值。

方法定义:(Int_Value).^(Short_Value)

返回类型:返回 int 和指定 short 值按位异或操作结果的值。

Example #1:

// Scala program of Int ^(x: Short)
      // method

      // Creating object
      object GfG
      { 

          // Main method
          def main(args:Array[String])
          {

              // Applying Int ^(x: Short) function
              val result = (15).^(2)

              // Displays output
              println(result)

          }
      } 
13

Example #2:

// Scala program of Int ^(x: Short)
      // method

      // Creating object
      object GfG
      { 

          // Main method
          def main(args:Array[String])
          {

              // Applying Int ^(x: Short) function
              val result = (15).^(3)

              // Displays output
              println(result)

          }
      } 
12

阅读更多:Scala 教程

Python教程

Java教程

Web教程

数据库教程

图形图像教程

大数据教程

开发工具教程

计算机教程