Scala Int <(x: Long)方法及示例
**< (x: Long) **方法用于在指定的int值小于long值时返回true,否则返回false。
方法定义:(Int_Value).<(Long_Value)
返回类型。如果指定的int值小于long值,则返回true,否则返回false。
例子 #1 :
// Scala program of Int <(x: Long)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying Int <(x: Long) function
val result = (100).<(110)
// Displays output
println(result)
}
}
输出。
true
例子#2
// Scala program of Int <(x: Long)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying Int <(x: Long) function
val result = (50).<(10)
// Displays output
println(result)
}
}
输出。
false
极客教程