Scala Char +(x: Double) 方法及示例
+(x: Double)方法用于找到指定字符值和类型为Double的“x”的和。
方法定义:def +(x: Double): Double
返回类型:它返回Double。
示例:1#
// Scala program of +(x: Double)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying +(x: Double) method
val result = 'E'.+(10.4311)
// Displays output
println(result)
}
}
79.4311
示例:2#
// Scala program of +(x: Double)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying +(x: Double) method
val result = 'E'.+(54.1233)
// Displays output
println(result)
}
}
123.1233
更多Scala相关文章,请阅读:Scala 教程
极客教程