object HanShu2{
def opt(x:String,y:String):String=>String={(z:String)=>(s"$x $y $z").toUpperCase
}
def main(args:Array[String]):Unit={
val f:String=>String=opt("wnn","cc")
val f1:String=f("love")println(f1)
val res:String=opt("aa","bb")("cc")println(res)}}
object Demo03{
def urlBuilder(ssl:Boolean,domain:String)={
val ss=if(ssl)"https://"else"http://"
ss+domain
}
def main(args:Array[String]):Unit={
val res:String=urlBuilder(true,"www.51doit.com")println(res)/*https://www.51doit.com*/
val res1:String=urlBuilder(false,"www.51doit.com")println(res1)/*http://www.51doit.com*/}}