self_example/Big_data_example/scala/scala0224
dingjiawen@xiaomi.com a9c30c8a91 增加一些scala和python相关 2023-08-16 15:36:26 +08:00
..
src/main/java/com/atguigu/scala 增加一些scala和python相关 2023-08-16 15:36:26 +08:00
Readme big_data_example 2022-05-15 19:40:58 +08:00
pom.xml big_data_example 2022-05-15 19:40:58 +08:00

Readme

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[_]