The difference between scala script and application

后端 未结 3 997
傲寒
傲寒 2020-12-06 11:58

What is the difference between a scala script and scala application? Please provide an example

The book I am reading says that a script must always end in a result e

3条回答
  •  無奈伤痛
    2020-12-06 12:24

    Well, I always thought this is a Scala script:

    $ cat script
    
    #!/usr/bin/scala
    !#
    
    println("Hello, World!")
    

    Running with simple:

    $ ./script
    

    An application on the other hand has to be compiled to .class and executed explicitly using java runtime.

提交回复
热议问题