Open In App

Scala Double +(x: Char) Method With Example

Last Updated : 03 Nov, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

The +(x: Char) method is used to find the sum of the specified double and the given ‘x’ type of char in the argument.

Syntax: def +(x: Char): Double
Returns: It return the sum of the specified double and the given char type ’x’.

Example 1:




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


Output:

70.39432456

Example 2:




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


Output:

100.3943245623


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads