Scala Int >(x: Double) 方法及示例
**>(x: Double) ** 方法用于返回指定的 int 值是否大于 double 值。
方法定义: (Int_Value).>(Double_Value)
返回类型: 如果指定的 int 值大于 double 值,则返回 true。
示例 #1:
// Scala program of Int >(x: Double)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying Int >(x: Double) function
val result = (65).>(10)
// Displays output
println(result)
}
}
true
示例 #2:
// Scala program of Int >(x: Double)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying Int >(x: Double) function
val result = (50).>(100)
// Displays output
println(result)
}
}
false
阅读更多:Scala 教程
极客教程