Scala Int /(x: Byte) 方法及示例
/(x: Byte) 方法用于返回指定int值除以字节值的商。
方法定义:(Int_Value)./(Byte_Value)
返回类型:返回指定int值除以字节值的商。
示例1:
// Scala program of Int /(x: Byte)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying Int /(x: Byte) function
val result = (100)./(10)
// Displays output
println(result)
}
}
10
示例2:
// Scala program of Int /(x: Byte)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying Int /(x: Byte) function
val result = (110)./(9)
// Displays output
println(result)
}
}
12
阅读更多:Scala 教程
极客教程