Scala Short *(x: Int)方法及示例
利用*(x: Int)
方法,可以找到所述Short值与Int类型的’x’的乘积。
方法定义:def *(x: Int):Int
返回类型。它返回Int。
例子:1#
// Scala program of *(x: Int)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying *(x: Int) method
val result = (700).*(10)
// Displays output
println(result)
}
}
输出。
7000
例如:2#
// Scala program of *(x: Int)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying *(x: Int) method
val result = (999).*(11)
// Displays output
println(result)
}
}
输出。
10989