Scala Char unary_~() method with example
Last Updated :
29 Oct, 2019
The unary_~() method is utilized to find the bit-wise negation value of the stated character.
Method Definition: def unary_~: Int
Return Type: It returns bit-wise negative value of the stated character.
Example: 1#
object GfG
{
def main(args : Array[String])
{
val result = 'A' .unary _ ~
println(result)
}
}
|
Example: 2#
object GfG
{
def main(args : Array[String])
{
val result = 'B' .unary _ ~
println(result)
}
}
|
Share your thoughts in the comments
Please Login to comment...