Scala Int &(x: Int) method with example
The &(x: Int) method is utilized to return a result of the bitwise AND operation on the specified int value by the int value.
Method Definition: (Int_Value).&(int_Value)
Return Type: It returns a result of the bitwise AND operation on the specified int value by the int value.
Example #1:
// Scala program of Int &(x: Int) // method // Creating object object GfG { // Main method def main(args:Array[String]) { // Applying Int &(x: Int) function val result = (10).&(6) // Displays output println(result) } } |
chevron_right
filter_none
Output:
2
Example #2:
// Scala program of Int &(x: Int) // method // Creating object object GfG { // Main method def main(args:Array[String]) { // Applying Int &(x: Int) function val result = (10).&(8) // Displays output println(result) } } |
chevron_right
filter_none
Output:
8
Recommended Posts:
- Scala Set map() method with example
- Scala Set last() method with example
- Scala Int <=(x: Int) method with example
- Scala Int %(x: Int) method with example
- Scala Int ==(x: Int) method with example
- Scala Map max() method with example
- Scala | map() method
- Scala Int <(x: Int) method with example
- Scala Set &() method with example
- Scala Int -(x: Int) method with example
- Scala Map min() method with example
- Scala Set take() method with example
- Scala Set sum() method with example
- Scala Set +() method with example
- Scala Set -() 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.


