Scala short &(x: long): Long
Short, a 16-bit signed integer (equivalent to Java’s short primitive type) is a subtype of scala.AnyVal. The &(x: Long) method is utilized to return a result of the bitwise AND operation on the specified long value by the long value.
Method Definition: def +(x: Long): Long
Return Type: It returns Long.
Example #1:
object GfG
{
def main(args : Array[String])
{
val result = ( 998 ).&( 100000 L)
println(result)
}
}
|
Output:
672
Example #2:
object GfG
{
def main(args : Array[String])
{
val result = ( 111 ).&(- 100000 L)
println(result)
}
}
|
Output:
96
Last Updated :
05 Dec, 2019
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...