Open In App

Scala short <=(x: Int): Boolean

Last Updated : 05 Dec, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

Short, a 16-bit signed integer (equivalent to Java’s short primitive type) is a subtype of scala.AnyVal. The <=(x: Int) method is utilized to return true if this value is less than or equal to x, false otherwise.

Method Definition: def <=(x: Int): Boolean

Return Type: It returns true if this value is less than or equal to x, otherwise false.

Example #1:




// Scala program of Short <=(x: Int) 
// method 
  
// Creating object 
object GfG 
  
    // Main method 
    def main(args:Array[String]) 
    
      
        // Applying Short <=(x: Int) function 
        val result = (998.toShort).<=(999:Int)
          
        // Displays output 
        println(result) 
      
    


Output:

True

Example #2:




// Scala program of Short <=(x: Int) 
// method 
  
// Creating object 
object GfG 
  
    // Main method 
    def main(args:Array[String]) 
    
      
        // Applying Short <=(x: Int) function 
        val result = (102.toShort).<=(101:Int)
          
        // Displays output 
        println(result) 
      
    


Output:

false


Similar Reads

Scala short &lt;(x: Short): Boolean
Short, a 16-bit signed integer (equivalent to Java's short primitive type) is a subtype of scala.AnyVal. The &lt;(x: Short) method is utilized to return true if this value is less than x, false otherwise. Method Definition: def &lt;(x: Short): Boolean Return Type: It returns true if this value is less than x, otherwise false. Example #1: // Scala p
1 min read
Scala short &gt;(x: Short): Boolean
Short, a 16-bit signed integer (equivalent to Java's short primitive type) is a subtype of scala.AnyVal. The &gt;(x: Short) method is utilized to return true if this value is greater than x, false otherwise. Method Definition: def &gt;(x: Short): Boolean Return Type: It returns true if this value is greater than x, otherwise false. Example #1: // S
1 min read
Scala short &gt;=(x: Short): Boolean
Short, a 16-bit signed integer (equivalent to Java's short primitive type) is a subtype of scala.AnyVal. The &gt;=(x: Short) method is utilized to return true if this value is greater than or equal to x, false otherwise. Method Definition: def &gt;=(x: Short): Boolean Return Type: It returns true if this value is greater than or equal to x, otherwi
1 min read
Scala short &lt;=(x: Short): Boolean
Short, a 16-bit signed integer (equivalent to Java's short primitive type) is a subtype of scala.AnyVal. The &lt;=(x: Short) method is utilized to return true if this value is less than or equal to x, false otherwise. Method Definition: def &lt;=(x: Short): Boolean Return Type: It returns true if this value is less than or equal to x, otherwise fal
1 min read
Scala short ==(x: Short): Boolean
Short, a 16-bit signed integer (equivalent to Java's short primitive type) is a subtype of scala.AnyVal. The ==(x: Short) method is utilized to return true if this value is equal to x, false otherwise. Method Definition: def ==(x: Short): Boolean Return Type: It returns true if this value is equal to x, otherwise false. Example #1: // Scala program
1 min read
Scala short /(x: Short): Int
Short, a 16-bit signed integer (equivalent to Java's short primitive type) is a subtype of scala.AnyVal. The /(x: Short) method is utilized to return a result of the quotient operation on the specified Short value by the x. Method Definition: def /(x: Short): Int Return Type: It returns quotient with value and x. Example #1: // Scala program of Sho
1 min read
Scala short &amp;(x: Short): Int
Short, a 16-bit signed integer (equivalent to Java's short primitive type) is a subtype of scala.AnyVal. The &amp;(x: Int) method is utilized to return a result of the bitwise AND operation on the specified short value by the Int value. Method Definition: def +(x: Short): Int Return Type: It returns Int. Example #1: // Scala program of Short &amp;(
1 min read
Scala short &lt;(x: Int): Boolean
Short, a 16-bit signed integer (equivalent to Java's short primitive type) is a subtype of scala.AnyVal. The &lt;(x: Int) method is utilized to return true if this value is less than x, false otherwise. Method Definition: def &lt;(x: Int): Boolean Return Type: It returns true if this value is less than x, otherwise false. Example #1: // Scala progr
1 min read
Scala short &gt;(x: Int): Boolean
Short, a 16-bit signed integer (equivalent to Java's short primitive type) is a subtype of scala.AnyVal. The &gt;(x: Int) method is utilized to return true if this value is greater than x, false otherwise. Method Definition: def &gt;(x: Int): Boolean Return Type: It returns true if this value is greater than x, otherwise false. Example #1: // Scala
1 min read
Scala short &gt;=(x: Int): Boolean
Short, a 16-bit signed integer (equivalent to Java's short primitive type) is a subtype of scala.AnyVal. The &gt;=(x: Int) method is utilized to return true if this value is greater than or equal to x, false otherwise. Method Definition: def &gt;=(x: Int): Boolean Return Type: It returns true if this value is greater than or equal to x, otherwise f
1 min read
Article Tags :