self_example/Big_data_example/scala/scala0224/Readme

25 lines
409 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

下划线的作用
1.声明变量,但是不能访问
val _ = "zhangsan"
2.将函数作为整体使用
val f = fun1 _
3.使用import语法时下划线可以代替星号
import java.Util._
4.使用import语法时下划线可以隐藏类
import java.sql.{Date->_}
5.模式匹配中,代表任意值
case _ => xxxx
6.泛型汇总,下划线表示任意类型
List[_]