Scala Library
|
|
scala/Function0.scala
]
trait
Function0[+R]
extends
AnyRefFunction with 0 parameters.
In the following example the definition of
currentSeconds
is a shorthand for the anonymous class
definition anonfun0
:
object Main extends Application { val currentSeconds = () => System.currentTimeMillis() / 1000L val anonfun0 = new Function0[Long] { def apply(): Long = System.currentTimeMillis() / 1000L } println(currentSeconds()) println(anonfun0()) }
Method Summary | |
abstract def
|
apply : R |
override def
|
toString
: java.lang.String
Returns a string representation of the object.
|
Methods inherited from AnyRef | |
getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
Method Details |
abstract
def
apply : R
override
def
toString : java.lang.String
The default representation is platform dependent.
Scala Library
|
|