* Here, object `Main` inherits the `main` method of `Application`.

* into executable programs. Here is an example:

/** The `Application` trait can be used to quickly turn objects

* <code>Application</code>. This can lead to a significant

* optimize or JIT the code in the body of an <code>object</code> extending

* Therefore, certain JVM configurations may become confused, or simply fail to

* JVM authors usually assume their execution to be relatively short.

* <li>Static initializers are run only once during program execution, and

* which occurs before <code>Application</code>'s <code>main</code> method

* extending <code>Application</code> is run as part of the static initialization

* command-line arguments because all code in body of an <code>object</code>

* <li>As described above, there is no way to obtain the

* it must synchronize with the enclosing object.</li>

* static initialization, concurrent code will <em>always</em> deadlock if

* initialization is complete. However, because the entire execution of an

* <li> Threaded code that references the object will block until static

* In practice the <code>Application</code> trait has a number of serious

* property. Here is an example for benchmarking object <code>Main</code>:

* <code>Application</code> by setting the global <code>scala.time</code>

* It is possible to time the execution of objects that inherit from class

* with the technique presented here).

* program depends on command-line arguments (which are not accessible

* defines the main program. This technique does not work if the main

* of <code>Application</code>. The body of the <code>Main</code> object

* Here, object <code>Main</code> inherits the <code>main</code> method

* Here is an example:

* into executable programs, but is <em>not recommended</em>.

* The <code>Application</code> trait can be used to quickly turn objects

* extending `Application` is now recommended over implementing `main` explicitly.

* Application code is now stored and run in the main method. As a consequence,

* application code would be run in the object constructor. This is no longer true.

* Note: The use of Application was discouraged prior to 2.9 because

* `arguments` returns the current command line arguments as an array.

* Instead, it is recommended to define a <code>main</code> method explicitly:

/** The time when the execution of this program started, in milliseconds since 1

80 /** The default main method.

81 *

41 /** The command line arguments passed to the application's `main` method.

42 */

43 protected def arguments: Array[String] = args

44

45 private var args: Array[String] = _

46

47 private val initCode = new ListBuffer[() => Unit]

48

49 /** The init hook. This saves all initialization code for execution within `main`.

50 * This methos is normally never called directly from user code.

51 * Instead it is called as compiler-generated code for those classes, objects, and traits

52 * that inherit from the `DelayedInit` trait and that do not themselves define

53 * a `delayedInit` method.

54 * @param body the initialization code to be stored for later execution

55 */

56 override def delayedInit(body: => Unit) {

57 initCode += (() => body)

58 }

59

60 /** The main method.

61 * This stores all argument so that they can be retrieved with `arguments`

62 * and the executes all initialization code segements in the order they were