A.sumSquare(1,2,3)=14B.sumSquare(2,4)=16C.sumSquare(6)=36D.sumSquare(1,1,2,3)=15
单项选择题对于函数def getGoodsPrice(goods:String) = {val prices = Map(“book” -> 5, “pen” -> 2, “sticker” -> 1)prices.getOrElse(goods, 0)}结果说法错误的是? ()
A.getGoodsPrice("book")//等于5B.getGoodsPrice("pen")//等于2C.getGoodsPrice("sticker")//等于1D.getGoodsPrice("sock")//等于“sock”
单项选择题关于数组的常用算法,下列说法错误的是? ()
A.Array(1,7,2,9).sum //等于19B.Array(1,7,2,9).sorted //等于Array(9,7,2,1)C.Array("one","two","three").max //等于"two"D.Array("one","two","three").mkString("-")//等于"one-two-three"
单项选择题以下单例对象,定义错误的是? ()
A.object A{var str =“”}B.object A(str:String){}C.object A{def str =“”}D.object A{val str =“”}
单项选择题关于和Scala进行交互的基本方式REPL说法错误的是?()
A.R 读取(read)B.E 求值(evaluate)C.P 解析(Parse)D.L 循环(Loop)
多项选择题scala使用哪些修饰符?()
A.publicB.scalaC.privateD.bool