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 = (100).!=(50)
// 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 = (100).!=(100)
// Displays output
println(result)
}
}
输出。
false
极客教程