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

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 教程

Python教程

Java教程

Web教程

数据库教程

图形图像教程

大数据教程

开发工具教程

计算机教程