Open In App

Scala Float isValidChar() method with example

Improve
Improve
Like Article
Like
Save
Share
Report

The isValidChar() method is utilized to return true if the specified number is either zero or lies within the range of scala.Char MinValue and MaxValue; otherwise returns false.

Method Definition: (Float_Number).isValidChar

Return Type: It returns true if the specified number is either zero or lies within the range of scala.Char MinValue and MaxValue; otherwise returns false.

Example #1:




// Scala program of Float isValidChar()
// method
  
// Creating object
object GfG
  
    // Main method
    def main(args:Array[String])
    {
      
        // Applying isValidChar method
        val result = (0).isValidChar
          
        // Displays output
        println(result)
      
    }


Output:

true

Example #2:




// Scala program of Float isValidChar()
// method
  
// Creating object
object GfG
  
    // Main method
    def main(args:Array[String])
    {
      
        // Applying isValidChar method
        val result = (5.9).isValidChar
          
        // Displays output
        println(result)
      
    }


Output:

false


Last Updated : 29 Oct, 2019
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads