|
|
Scala 2.2.0.9025
|
abstract
trait
Function2
[T0, T1, R]
extends
java.lang.Object with
scala.ScalaObjectmax is a shorthand for the anonymous class definition
anonfun2:
object Main extends Application {
val max = (x: Int, y: Int) => if (x < y) y else x
val anonfun2 = new Function2[Int, Int, Int] {
def apply(x: Int, y: Int): Int = if (x < y) y else x
}
Console.println(max(0, 1))
Console.println(anonfun2(0, 1))
}| Def Summary | |
abstract
|
def
apply
(v0: T0, v1: T1)
: R
|
override
|
def
toString
: java.lang.String
|
| Def Detail |
abstract
def
apply
(v0: T0, v1: T1): R
override
def
toString
: java.lang.String