Scala Int *(x: Long) 方法及示例
*(x: Long) 方法用于返回指定 int 值和 long 值的乘积。
方法定义:(Int_Value).*(Long_Value)
返回类型:返回指定 int 值和 long 值的乘积。
示例1:
// Scala program of Int *(x: Long)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying Int *(x: Long) function
val result = (100).*(5)
// Displays output
println(result)
}
}
500
示例2:
// Scala program of Int *(x: Long)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying Int *(x: Long) function
val result = (10).*(20)
// Displays output
println(result)
}
}
200
阅读更多:Scala 教程
极客教程