Scala Int &(x: Byte)方法及示例
该方法用于将byte值的按位AND操作的结果返回指定的int值。
方法定义:(Int_Value).&(byte_Value)
返回类型:返回byte值的按位AND操作的结果。
示例1:
// Scala program of Int &(x: Byte)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying Int &(x: byte) function
val result = (10).&(6)
// Displays output
println(result)
}
}
2
示例2:
// Scala program of Int &(x: Byte)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying Int &(x: Byte) function
val result = (10).&(8)
// Displays output
println(result)
}
}
8
阅读更多:Scala 教程
极客教程