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