Scala Short !=(x: Int)方法及示例
!=(x: Int)
方法是用来检查所述Short值是否不等于’x’。而’x’是Int类型的。
方法定义:def !=(x: Int): Boolean
返回类型。如果所述的Short值不等于’x’,它将返回真,否则将返回假。
例子: 1#
// Scala program of !=(x: Int)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying !=(x: Int) method
val result = (1000).!=(34)
// Displays output
println(result)
}
}
输出。
true
例如:2#
// Scala program of !=(x: Int)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying !=(x: Int) method
val result = (666).!=(666)
// Displays output
println(result)
}
}
输出。
false