Scala Int >>>(x: Short) 方法与示例
>>>(x: Short)方法用于返回一个值,该值是 int 值右移指定的 short 值的结果。这里左边的位用零填充。
Method Definition: (Int_Value).>>>(Short_Value)
Return Type: It returns a value which is the result of the int value right bit shifting by the specified short value.
示例 #1:
// Scala program of Int >>>(x: Short)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying Int >>>(x: Short) function
val result = (15).>>>(2)
// Displays output
println(result)
}
}
输出:
3
示例 #2:
// Scala program of Int >>>(x: Short)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying Int >>>(x: Short) function
val result = (15).>>>(3)
// Displays output
println(result)
}
}
输出:
1
在评论中写代码?请使用 ide.geeksforgeeks.org,生成链接并在此处分享链接。