Why I can't execute scala file?

前端 未结 9 2050
日久生厌
日久生厌 2020-12-10 02:49

I am a newbie to Scala, it\'s the first time I\'m running Scala, when I installed Scala, I created a file named Hello.scala, the content is:

pr         


        
9条回答
  •  失恋的感觉
    2020-12-10 03:38

    If you are executing it in scala REPL .You should be using as below

    :load [scala file path]
    

    output would be as below

    defined "objectname"

    Then invoke the main method as the next command

    objectname.main(Array())
    

    Refer the below url for more detailed info

    https://www.scala-lang.org/documentation/getting-started.html

提交回复
热议问题