Scala Short *(x: Byte) 方法及示例
*(x: Byte)
方法用于找到指定 Short 值和类型为 Byte 的 ‘x’ 的乘积。
方法定义:def *(x: Byte): Int
返回类型:返回 Int。
示例 1#
// Scala program of *(x: Byte)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying *(x: Byte) method
val result = (777).*(126)
// Displays output
println(result)
}
}
97902
示例 2#
// Scala program of *(x: Byte)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying *(x: Byte) method
val result = (-1000).*(-125)
// Displays output
println(result)
}
}
125000
阅读更多:Scala 教程