Open In App

Scala Byte &(x: Int): Int

Last Updated : 14 Jan, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

In Scala, Byte is a 8-bit signed integer (equivalent to Java’s byte primitive type). The method &(x:Int) method is utilized to return the bitwise AND of this value and x.

Method Definition: Byte &(x: Int): Int
Return Type: It returns the bitwise AND of this value and x.

Example #1:




// Scala program of Byte &(x: Int)
// method 
  
// Creating object 
object GfG 
  
    // Main method 
    def main(args:Array[String]) 
    
      
        // Applying Byte &(x: Int) function 
        val result = (167.toByte).&(125:Int) 
          
        // Displays output 
        println(result) 
      
    


Output:

37

Example #2:




// Scala program of Byte &(x: Int)
// method 
  
// Creating object 
object GfG 
  
    // Main method 
    def main(args:Array[String]) 
    
      
        // Applying Byte &(x: Int) function 
        val result = (128.toByte).&(2:Int) 
          
        // Displays output 
        println(result) 
      
    


Output:

0


Similar Reads

Scala Byte &(x: Byte): Int
In Scala, Byte is a 8-bit signed integer (equivalent to Java's byte primitive type). The method &(x:Byte) method is utilized to return the bitwise AND of this value and x. Method Definition: Byte &(x: Byte): Int Return Type: It returns the bitwise AND of this value and x. Example #1: // Scala program of Byte &(x: Byte) // method // Crea
1 min read
Scala Byte *(x: Byte): Int
In Scala, Byte is a 8-bit signed integer (equivalent to Java's byte primitive type). The method *(x:Byte) method is utilized to return the product of this value and x. Method Definition: Byte *(x: Byte): Int Return Type: It returns the product of this value and x. Example #1: // Scala program of Byte *(x: Byte) // method // Creating object object G
1 min read
Scala Byte /(x: Byte): Int
In Scala, Byte is a 8-bit signed integer (equivalent to Java's byte primitive type). The method /(x:Byte) method is utilized to return the quotient of this value and x. Method Definition: Byte /(x: Byte): Int Return Type: It returns the quotient of this value and x. Example #1: // Scala program of Byte /(x: Byte) // method // Creating object object
1 min read
Scala Byte ^(x: Byte): Int
In Scala, Byte is a 8-bit signed integer (equivalent to Java's byte primitive type). The method ^(x:Byte) method is utilized to return the bitwise XOR of this value and x. Method Definition: Byte ^(x: Byte): Int Return Type: It returns return the bitwise XOR of this value and x. Example #1: // Scala program of Byte ^(x: Byte) // method // Creating
1 min read
Scala Byte %(x: Int): Int
In Scala, Byte is a 8-bit signed integer (equivalent to Java's byte primitive type). The method %(x:Int) method is utilized to return the remainder of the division of this value by x Method Definition: Byte %(x: Int): Int Return Type: It returns the remainder of the division of this value by x. Example #1: // Scala program of Byte %(x: Int) // meth
1 min read
Scala Byte -(x: Int): Int
In Scala, Byte is a 8-bit signed integer (equivalent to Java's byte primitive type). The method -(x:Int) method is utilized to return the difference of this value by x Method Definition: Byte -(x: Int): Int Return Type: It returns the difference of this value by x. Example #1: // Scala program of Byte -(x: Int) // method // Creating object object G
1 min read
Scala Byte *(x: Int): Int
In Scala, Byte is a 8-bit signed integer (equivalent to Java's byte primitive type). The method *(x:Int) method is utilized to return the product of this value and x. Method Definition: Byte *(x: Int): Int Return Type: It returns the product of this value and x. Example #1: // Scala program of Byte *(x: Int) // method // Creating object object GfG
1 min read
Scala Byte ^(x: Int): Int
In Scala, Byte is a 8-bit signed integer (equivalent to Java's byte primitive type). The method ^(x:Int) method is utilized to return the bitwise XOR of this value and x. Method Definition: Byte ^(x: Int): Int Return Type: It returns return the bitwise XOR of this value and x. Example #1: // Scala program of Byte ^(x: Int) // method // Creating obj
1 min read
Scala Byte /(x: Int): Int
In Scala, Byte is a 8-bit signed integer (equivalent to Java's byte primitive type). The method /(x:Int) method is utilized to return the quotient of this value and x. Method Definition: Byte /(x: Int): Int Return Type: It returns the quotient of this value and x. Example #1: // Scala program of Byte /(x: Int) // method // Creating object object Gf
1 min read
Scala Byte +(x: Int): Int
In Scala, Byte is a 8-bit signed integer (equivalent to Java's byte primitive type). The method +(x:Int) method is utilized to return the sum of this value by x Method Definition: Byte +(x: Int): Int Return Type: It returns the sum of this value by x. Example #1: // Scala program of Byte +(x: Int) // method // Creating object object GfG { // Main m
1 min read
Article Tags :