Open In App

Scala Long !=(x: Short) method with example

Last Updated : 02 Nov, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

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:




// Scala program to explain working 
// of Long !=(x: Short) function
  
// Creating object
object GfG
  
    // Main method
    def main(args:Array[String])
    {
      
        // Applying !=(x: Short) function
        val result = (66).toLong.!= (66:Short)
          
        // Displays output
        println(result)
      
    }


Output:

false

 

Example #2:




// Scala program to explain working
// of Long !=(x: Short) function
  
// Creating object
object GfG
  
    // Main method
    def main(args:Array[String])
    {
      
        // Applying !=(x: Short) function
        val result = 1186000000.toLong.!= (16:Short)
          
        // Displays output
        println(result)
      
    }


Output:

true


Previous Article
Next Article

Similar Reads

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: // Scala program of Short
1 min read
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 quotient operation on the specified Long value by the x. Method Definition: def /(x: Long): Long Return Type: It returns quotient with value and x. Example #1: // Scala program of Short
1 min read
Scala Short !=(x: Short) method with example
The !=(x: Short) method is utilized to check if the stated Short value is not equal to 'x'. And the 'x' is of type Short. Method Definition: def !=(x: Short): Boolean Return Type: It returns true if the stated Short value is not equal to 'x' else it returns false. Example: 1# // Scala program of !=(x: Short) // method // Creating object object GfG
1 min read
Scala Short %(x: Short) method with example
The %(x: Short) method is utilized to find the remainder of the division of the stated Short value by 'x' of type Short. Method Definition: def %(x: Short): Int Return Type: It returns Int. Example: 1# // Scala program of %(x: Short) // method // Creating object object GfG { // Main method def main(args:Array[String]) { // Applying %(x: Short) meth
1 min read
Scala Short *(x: Short) method with example
The *(x: Short) method is utilized to find the product of the stated Short value and 'x' of type Short. Method Definition: def *(x: Short): Int Return Type: It returns Int. Example: 1# // Scala program of *(x: Short) // method // Creating object object GfG { // Main method def main(args:Array[String]) { // Applying *(x: Short) method val result = (
1 min read
Scala Short +(x: Short) method with example
The +(x: Short) method is utilized to find the sum of the stated Short value and 'x' of type Short. Method Definition: def +(x: Short): Int Return Type: It returns Int. Example: 1# // Scala program of +(x: Short) // method // Creating object object GfG { // Main method def main(args:Array[String]) { // Applying +(x: Short) method val result = (111)
1 min read
Scala Short -(x: Short) method with example
The -(x: Short) method is utilized to find the difference of the stated Short value and 'x' of type Short. Method Definition: def -(x: Short): Int Return Type: It returns Int. Example: 1# // Scala program of -(x: Short) // method // Creating object object GfG { // Main method def main(args:Array[String]) { // Applying -(x: Short) method val result
1 min read
Scala Short -(x: Long) method with example
The -(x: Long) method is utilized to find the difference of the stated Short value and 'x' of type Long. Method Definition: def -(x: Long): Long Return Type: It returns Long. Example: 1# // Scala program of -(x: Long) // method // Creating object object GfG { // Main method def main(args:Array[String]) { // Applying -(x: Long) method val result = (
1 min read
Scala Short %(x: Long) method with example
The %(x: Long) method is utilized to find the remainder of the division of the stated Short value by 'x' of type Long. Method Definition: def %(x: Long): Long Return Type: It returns Long. Example: 1# // Scala program of %(x: Long) // method // Creating object object GfG { // Main method def main(args:Array[String]) { // Applying %(x: Long) method
1 min read
Scala Short +(x: Long) method with example
The +(x: Long) method is utilized to find the sum of the stated Short value and 'x' of type Long. Method Definition: def +(x: Long): Long Return Type: It returns Long. Example: 1# // Scala program of +(x: Long) // method // Creating object object GfG { // Main method def main(args:Array[String]) { // Applying +(x: Long) method val result = (998).+(
1 min read
Article Tags :