Open In App

Scala Float ==(x: Char) method with example

Last Updated : 14 Sep, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

The ==(x: Char) method is utilized to return true if the float value is equal to the  char value, otherwise, return false. Here the char value is nothing but the ASCII value of the specified char.

Method Definition: (Float_Value).==(Char_Value) Return Type: It returns true if the float value is equal to the char value, otherwise return false.

Example #1: 

Scala




// Scala program of Float ==(x: Char)
// method
 
// Creating object
object GfG
{
 
    // Main method
    def main(args:Array[String])
    {
     
        // Applying ==(x: Char) function
        val result = (100.0).==('A')
         
        // Displays output
        println(result)
     
    }
}


Output:

false

Example #2: 

Scala




// Scala program of Float ==(x: Char)
// method
 
// Creating object
object GfG
{
 
    // Main method
    def main(args:Array[String])
    {
     
        // Applying ==(x: Char) function
        val result = (65.0).==('A')
         
        // Displays output
        println(result)
     
    }
}


Output:

true


Similar Reads

Scala Char to(end: Char, step: Char) method with example
The to(end: Char, step: Char) method is utilized to return a range from the stated character to the 'end', which is given in the arguments list and some "step" is also specified in the arguments list. Method Definition: def to(end: Char, step: Char): Inclusive[Char] Return Type: It returns the range. Example: 1# // Scala program of to() // method /
1 min read
Scala Float to(end: Float, step: Float) method with example
The to(end: FLoat, step: Float) method is utilized to return a range from the stated float value to the 'end', which is given in the arguments list and some step is also specified in the arguments list. Method Definition: def to(end: Float, step: Float): Inclusive Return Type: It returns the range. Example #1: // Scala program of Float to() // meth
1 min read
Scala Float until(end: Float, step: Float) method with example
The until(end: Float, step: Float) method is utilized to return a range from the start value to exact previous value of specified end float value. Here the range's values are jumping by step value. Method Definition: defuntil(end: Float, step: Float): collection.immutable.Range Return Type: It returns the range. Example #1: // Scala program of Floa
1 min read
Scala Char |(x: Char) method with example
The |(x: Char) method is utilized to find the bit-wise OR of the stated character value and given 'x' in the argument list. Method Definition: def|(x: Char): Int Return Type: It returns the bit-wise OR of the stated character value and given 'x'. Example: 1# // Scala program of |(x: Char) // method // Creating object object GfG { // Main method def
1 min read
Scala Char ^(x: Char) method with example
The ^(x: Char) method is utilized to find the bit-wise XOR of the stated character and the given 'x' of type character in the argument list. Method Definition: def ^(x: Char): Int Return Type: It returns the bit-wise XOR of the stated character and given character type "x". Example: 1# // Scala program of ^(x: Char) // method // Creating object obj
1 min read
Scala Char >=(x: Char) method with example
The >=(x: Char) method is utilized to find if the stated character value is greater than or equal to 'x' or not. And the type of 'x' must be Char. Method Definition: def >=(x: Char): Boolean Return Type: It returns true if the stated character value is greater than or equal to "x" else it returns false. Example: 1# // Scala program of >=(x
1 min read
Scala Char >(x: Char) method with example
The >(x: Char) method is utilized to find if the stated character value is greater than 'x' or not. And the type of 'x' must be Char. Method Definition: def >(x: Char): Boolean Return Type: It returns true if the stated character value is greater than "x" else it returns false. Example: 1# // Scala program of >(x: Char) // method // Creati
1 min read
Scala Char ==(x: Char) method with example
The ==(x: Char) method is utilized to find if the stated character value is equal to 'x' or not. And the type of 'x' must be Char. Method Definition: def ==(x: Char): Boolean Return Type: It returns true if the stated character value is equal to "x" else it returns false. Example: 1# // Scala program of ==(x: Char) // method // Creating object obje
1 min read
Scala Char <=(x: Char) method with example
The <=(x: Char) method is utilized to find if the stated character value is less than or equal to 'x' or not. And the type of 'x' must be Char. Method Definition: def <=(x: Char): Boolean Return Type: It returns true if the stated character value is less than or equal to "x" else it returns false. Example: 1# // Scala program of <=(x: Char
1 min read
Scala Char !=(x: Char) method with example
The !=(x: Char) method is utilized to check if the stated character value is not equal to 'x'. And the 'x' is of type Char. Method Definition: def !=(x: Char): Boolean Return Type: It returns true if the stated character value is not equal to 'x' else it returns false. Example: 1# // Scala program of !=(x: Char) // method // Creating object object
1 min read
Article Tags :