1. def ma(x: Int)(y:Int) = x * y
    2. ma(2)(6)
    3. println(ma(2)(6))
    1. scala> def mb(x: Int) = (y: Int) => x * y
    2. mb: (x: Int)Int => Int
    3. scala> mb(2)
    4. res1: Int => Int = $$Lambda$1075/1699826397@79e7188e
    5. scala> mb(2)(7)
    6. res2: Int = 14

    定义个默认值

    1. def ma(x: Int)(implicit y:Int = 100) = x * y
    2. println(ma(2))

    隐式值导入

    他会寻找同类型的,找到类型一样的就用这个值
    但是不能在多个类中找到

    1. object Context {
    2. implicit val aaa: Int = 1024
    3. }
    4. object CaseDemo extends App {
    5. def ma(x: Int)(implicit y:Int = 100) = x * y
    6. import Context._
    7. println(ma(2))
    8. }