A.字符序列B.LongC.IntD.Short
单项选择题函数def swap[S,T](tup: (S,T))={ tup match{ case (a,b) => (b,a) } }的作用是? ()
A.完成2个数的交换B.完成2个数的相加C.完成2个数的相乘D.以上都不是
单项选择题Java:for(int i=10;i>=0;i–)System.out.println(i)在scala中怎么表示? ()
A.for(i < -1to 10reverse)print(i)B.for(i < -0to 10reverse)print(i)C.for(i < -1to 10)print(i)D.for(i < -1to 11reverse)print(i)
单项选择题crazy 3的结果是?()
A.crazy3B.crazycrazycrazyC.crazycrazyD.以上都不是
单项选择题BigInt(2).pow(1024)起什么作用?()
A.计算2的1024次方B.计算1024的2次方C.计算1024*2D.以上都不是
单项选择题Hello .reverse(0)起什么作用? ()
A.获取首字符B.获取尾字符C.获取第2个字符D.以上都不是
单项选择题Hello .take(1) 起什么作用? ()
单项选择题可以正确匹配 12340 的正则表达式是? ()
A."\s+[0-9]+\s+".rB.""\s+[0-4]+\s+".rC."""\s+\d+\s+""".rD.以上均不正确
单项选择题定义一个类,定义正确的是? ()
A.class House(name){def getname =“beijing”}B.class house {name =“nanjing”}C.class House {public var counter:String =“shanghai”}D.class house (var name:String){private def getName =name}
单项选择题scala中def mul(x:Int)(y:Int) = xy称作 ()
A.柯里化函数B.匿名函数C.高阶函数D.偏应用函数
多项选择题有关柯里化描述正确的是? ()
A.柯里化是指将原来接受两个参数的函数变成新的接受一个参数的函数的过程。新的函数返回一个以原有第二个参数作为参数的函数B.有时,使用柯里化将某个函数参数单拎出来,可以提供更多用于类型推断的信息C.将函数def add(x:Int,y:Int)=x +y,变形为def add(x:Int)(y:Int)=x +y的过程是一个柯里化过程D.柯里化是多参数列表函数的特例