Open In App

Scala Char <(x: Short) method with example

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

The <(x: Short) method is utilized to find if the stated character value is less than ‘x’ or not. And the type of ‘x’ must be Short.

Method Definition: def <(x: Short): Boolean

Return Type: It returns true if the stated character value is less than “x” else it returns false.

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 = 'D'.<(10000)
          
        // Displays output
        println(result)
      
    }


Output:

true

Example: 2#




// Scala program of <(x: Short)
// method
  
// Creating object
object GfG
  
    // Main method
    def main(args:Array[String])
    {
      
        // Applying <(x: Short) method
        val result = 'D'.<(-10000)
          
        // Displays output
        println(result)
      
    }


Output:

false


Similar Reads

Scala Char to(end: Char, step: Char) method with example
The to(end: Char, step: Char) method is utilized to return a range from the stated character to the 'end', which is given in the arguments list and some "step" is also specified in the arguments list. Method Definition: def to(end: Char, step: Char): Inclusive[Char] Return Type: It returns the range. Example: 1# // Scala program of to() // method /
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 Char |(x: Short) method with example
The |(x: Short) method is utilized to find the bit-wise OR of the stated character value and given "x" in the argument list which must be of type Short. Method Definition: def |(x: Short): Short Return Type: It returns the bit-wise OR of the stated character value and given Short type "x". Example: 1# // Scala program of |(x: Short) // method // Cr
1 min read
Scala Char ^(x: Short) method with example
The ^(x: Short) method is utilized to find the bit-wise XOR of the stated character and the given 'x' of type Short in the argument list. Method Definition: def ^(x: Short): Int Return Type: It returns the bit-wise XOR of the stated character and given Short type "x". Example: 1# // Scala program of ^(x: Short) // method // Creating object object G
1 min read
Scala Char &gt;(x: Short) method with example
The &gt;(x: Short) method is utilized to find if the stated character value is greater than 'x' or not. And the type of 'x' must be Short. Method Definition: def &gt;(x: Short): Boolean Return Type: It returns true if the stated character value is greater than "x" else it returns false. Example: 1# // Scala program of &gt;(x: Short) // method // Cr
1 min read
Scala Char ==(x: Short) method with example
The ==(x: Short) method is utilized to find if the stated character value is equal to 'x' or not. And the type of 'x' must be Short. Method Definition: def ==(x: Short): Boolean Return Type: It returns true if the stated character value is equal to "x" else it returns false. Example: 1# // Scala program of ==(x: Short) // method // Creating object
1 min read
Article Tags :