1 :_*符号的作用
1. 转化为参数序列
scala> val s = sum(1 to 3: _*)
s: Int = 6
2.变量声明中的模式
scala> val arr = Array(1,2,3)
arr: Array[Int] = Array(1, 2, 3)
scala> val Array(first, second, _*) = arr
first: Int = 1
second: Int = 2
2 字符串处理
2.1 字符串常用工具类
1 import org.apache.commons.lang3.StringUtils
3. Junit单元测试报错
java.lang.Exception: Test class should have exactly one public constructor
原因:不能用于object, 只能用于class
4. 异常处理
try {
cal.setTime( sdf.parse( date ) )
new SimpleDateFormat( outputFormat ).format( cal.getTime )
} catch {
case e: Exception => null
}