Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Scala Double +(x: Char) Method With Example

  • Last Updated : 03 Nov, 2019

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


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!