ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的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)) ~~~