Scala Char |(x: Short) method with example
The |(x: Short) method is utilized to find the bit-wise OR of the stated character value and given “x” in the argument list which must be of type Short.
Method Definition: def |(x: Short): Short
Return Type: It returns the bit-wise OR of the stated character value and given Short type “x”.
Example: 1#
object GfG
{
def main(args : Array[String])
{
val result = 'B' .|( 10000 )
println(result)
}
}
|
Example: 2#
object GfG
{
def main(args : Array[String])
{
val result = 'B' .|(- 20000 )
println(result)
}
}
|
Last Updated :
29 Oct, 2019
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...