Scala Int *(x: Short)方法及示例

Scala Int *(x: Short)方法及示例

利用*(x: Short) 方法来返回指定的int值和short值的乘积。

方法定义:(Int_Value).*(Short_Value)

返回类型。它返回指定的int值和short值的乘积。

例子 #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 = (100).*(5)
          
        // Displays output
        println(result)
      
    }
} 

输出。

500

例子#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 = (10).*(20)
          
        // Displays output
        println(result)
      
    }
} 

输出。

200

Python教程

Java教程

Web教程

数据库教程

图形图像教程

大数据教程

开发工具教程

计算机教程