Scala Char >(x: Byte) 方法及示例

Scala Char >(x: Byte) 方法及示例

(x: Byte) 方法用于查找指定的字符值是否大于“x”,“x”的类型必须是 Byte。

方法定义:def >(x: Byte): Boolean

返回类型:如果指定字符的值大于“x”,则返回 true,否则返回 false。

示例一:

// Scala program of >(x: Byte)
// method
  
// Creating object
object GfG
{ 
  
    // Main method
    def main(args:Array[String])
    {
      
        // Applying >(x: Byte) method 
        val result = 'D'.>(127)
          
        // Displays output
        println(result)
      
    }
} 
false

示例二:

// Scala program of >(x: Byte)
// method
  
// Creating object
object GfG
{ 
  
    // Main method
    def main(args:Array[String])
    {
      
        // Applying >(x: Byte) method
        val result = 'D'.>(-127)
          
        // Displays output
        println(result)
      
    }
} 
true

更多Scala相关文章,请阅读:Scala 教程

Python教程

Java教程

Web教程

数据库教程

图形图像教程

大数据教程

开发工具教程

计算机教程