The command line arguments passed to the application's main
method.
The command line arguments passed to the application's main
method.
The init hook.
The init hook. This saves all initialization code for execution within main
.
This method is normally never called directly from user code.
Instead it is called as compiler-generated code for those classes and objects
(but not traits) that inherit from the DelayedInit
trait and that do not
themselves define a delayedInit
method.
the initialization code to be stored for later execution
The time when the execution of this program started, in milliseconds since 1 January 1970 UTC.
Returns string formatted according to given format
string.
Returns string formatted according to given format
string.
Format strings are as for String.format
(@see java.lang.String.format).
The main method.
The main method.
This stores all argument so that they can be retrieved with args
and the executes all initialization code segments in the order they were
passed to delayedInit
the arguments passed to the main method
The
App
trait can be used to quickly turn objects into executable programs. Here is an example:Here, object
Main
inherits themain
method ofApp
.args
returns the current command line arguments as an array.Caveats
It should be noted that this trait is implemented using the DelayedInit functionality, which means that fields of the object will not have been initialized before the main method has been executed.
It should also be noted that the
main
method will not normally need to be overridden: the purpose is to turn the whole class body into the “main method”. You should only chose to override it if you know what you are doing.2.1, 15/02/2011