Scala Double +(x: String) Method With Examples
Last Updated :
03 Nov, 2019
The +(x: String) method is used to find the sum of the specified double and the given ‘x’ type of string in the argument.
Syntax: def +(x: String): Double
Returns: It return the sum of the specified double and the given string type ’x’.
Example 1:
object GfG
{
def main(args : Array[String])
{
val result = 1.3943245623 .+( "Geeks" )
println(result)
}
}
|
Output:
1.3943245623Geeks
Example 2:
object GfG
{
def main(args : Array[String])
{
val result = 2.394324562334 .+( "gfg" )
println(result)
}
}
|
Output:
2.394324562334gfg
Share your thoughts in the comments
Please Login to comment...