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 教程
极客教程