Open In App

Scala Char <<(x: Int) method with example

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

The <<(x: Int) method is utilized to find the character value which is bit-shifted left by the number of bits specified in the argument list of type Int, And the new bits are filled with zeroes.

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

Return Type: It returns an integer.

Example: 1#




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


Output:

570425344

Example: 2#




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


Output:

34816


Previous Article
Next Article

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 String regionMatches(int toffset, String other, int offset, int len) method with example
The regionMatches(int toffset, String other, int offset, int len) method is used to check if two string regions are equal or not. However, here ignoreCase is not included. Method Definition:Boolean regionMatches(int toffset, String other, int offset, int len) Return Type: It returns true if two string region matches else it returns false. Example #
1 min read
Scala Int to(end: int, step: int) method with example
The to(end: int, step: int) method is utilized to return a range from the stated integer 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: Int, step: Int): Inclusive Return Type: It returns the range. Example #1: // Scala program of Int to() // method // Creating
1 min read
Scala Int until(end: Int, step: Int) method with example
The until(end: Int, step: Int) method is utilized to return a range from the start value to exact previous value of specified end integer value. Here the range's values are jumping by step value. Method Definition: defuntil(end: Int, step: Int): collection.immutable.Range Return Type: It returns the range. Example #1: // Scala program of Int until(
1 min read
Scala Char |(x: Char) method with example
The |(x: Char) method is utilized to find the bit-wise OR of the stated character value and given 'x' in the argument list. Method Definition: def|(x: Char): Int Return Type: It returns the bit-wise OR of the stated character value and given 'x'. Example: 1# // Scala program of |(x: Char) // method // Creating object object GfG { // Main method def
1 min read
Scala Char ^(x: Char) method with example
The ^(x: Char) method is utilized to find the bit-wise XOR of the stated character and the given 'x' of type character in the argument list. Method Definition: def ^(x: Char): Int Return Type: It returns the bit-wise XOR of the stated character and given character type "x". Example: 1# // Scala program of ^(x: Char) // method // Creating object obj
1 min read
Scala Char &gt;=(x: Char) method with example
The &gt;=(x: Char) method is utilized to find if the stated character value is greater than or equal to 'x' or not. And the type of 'x' must be Char. Method Definition: def &gt;=(x: Char): Boolean Return Type: It returns true if the stated character value is greater than or equal to "x" else it returns false. Example: 1# // Scala program of &gt;=(x
1 min read
Scala Char &gt;(x: Char) method with example
The &gt;(x: Char) method is utilized to find if the stated character value is greater than 'x' or not. And the type of 'x' must be Char. Method Definition: def &gt;(x: Char): 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: Char) // method // Creati
1 min read
Scala Char ==(x: Char) method with example
The ==(x: Char) method is utilized to find if the stated character value is equal to 'x' or not. And the type of 'x' must be Char. Method Definition: def ==(x: Char): 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: Char) // method // Creating object obje
1 min read
Scala Char &lt;=(x: Char) method with example
The &lt;=(x: Char) method is utilized to find if the stated character value is less than or equal to 'x' or not. And the type of 'x' must be Char. Method Definition: def &lt;=(x: Char): Boolean Return Type: It returns true if the stated character value is less than or equal to "x" else it returns false. Example: 1# // Scala program of &lt;=(x: Char
1 min read
Article Tags :