Scala Long !=(x: Byte) method with example
In Scala, Long is a 64-bit signed integer, which is equivalent to Java’s long primitive type. The !=(x: Byte) method is utilized to check whether the given Long and Byte value are equal to each other or not.
Method Definition – def !=(x: Byte): Boolean
Returns – Returns true if this value is not equal to x, false otherwise.
Example #1:
object GfG
{
def main(args : Array[String])
{
val result = (- 128 ).toLong.! = (- 2 ^ 7 : Byte)
println(result)
}
}
|
Output:
true
Example #2:
object GfG
{
def main(args : Array[String])
{
val result = 16 .toLong.! = ( 2 ^ 4 : Byte)
println(result)
}
}
|
Output:
true
Last Updated :
02 Nov, 2019
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...