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