Scala Char |(x: Short) 方法示例
|(x: Short)方法用于查找所述字符值的按位或,并在必须为 Short 类型的参数列表中给出“x”。
Method Definition: def |(x: Short): Short
Return Type: It returns the bit-wise OR of the stated character value and given Short type “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