Scala Int <(x: Short)方法及示例
利用 **< (x: Short) **方法,如果指定的int值小于short值,返回true,否则返回false。
方法定义:(Int_Value).<(Short_Value)
返回类型。如果指定的int值小于short值,则返回true,否则返回false。
例子 #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).<(110)
// Displays output
println(result)
}
}
输出。
true
例子#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 = (50).<(10)
// Displays output
println(result)
}
}
输出。
false
极客教程