企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持知识库和私有化部署方案 广告
* 插值和多行字符串 ~~~ object StringApp extends App{ val s = "Hello:" val name = "Bizz" //插值 println(s"$s$name") //多行字符串 val b = """ |多行字符串 |??? |hello |""".stripMargin println(b) } ~~~ * 匿名函数 ~~~ object NoNameFun extends App{ val add = (x:Int,y:Int)=>{x+y} println(add(2,3)) } ~~~ * curry ~~~ def sum2(a:Int)(b:Int) = a + b println(sum2(2)(3)) ~~~