In Scala, Long is a 64-bit signed integer, which is equivalent to Java’s long primitive type. The !=(x: Int) method is utilized to check whether the given Long and int value are equal to each other or not.
Method Definition – def !=(x: Int): Boolean
Returns – Returns true if this value is not equal to x, false otherwise.
Example #1:
// Scala program to explain working // of Long !=(x: Int) function // Creating object object GfG { // Main method def main(args:Array[String]) { // Applying !=(x: Int) function val result = (10).toLong.!= (10:Int) // Displays output println(result) } } |
chevron_right
filter_none
Output:
false
Example #2:
// Scala program to explain working // of Long !=(x: Int) function // Creating object object GfG { // Main method def main(args:Array[String]) { // Applying !=(x: Int) function val result = 1186000000.toLong.!= (1296:Int) // Displays output println(result) } } |
chevron_right
filter_none
Output:
true
Recommended Posts:
- Scala short <(x: Short): Boolean
- Scala short <(x: Char): Boolean
- Scala | Partially Applied functions
- Scala String indexOf(String str) method with example
- Scala String contentEquals() method with example
- Scala Int /(x: Int) method with example
- Scala Int /(x: Short) method with example
- Scala Map size() method with example
- Scala SortedMap addString() method with a start, a separator and an end with example
- Scala Iterator addString() method with example
- Scala String substring(int beginIndex, int endIndex) method with example
- Scala | Functions Call-by-Name
- Scala Set &() method with example
- Program to convert Java set of Shorts to an Indexed Sequence in Scala
- Scala Int <(x: Char) method with example
- Scala Int <=(x: Double) method with example
- Scala Int <=(x: Byte) method with example
- Parameterless Method in Scala
- Scala short /(x: Short): Int
- Scala Set dropRight() method with example
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

