環境: CentOS
第一印象:
創建一個hello.scala 腳本,腳本可以取任何名字任何後綴。
$ touch hello.scala
$ vim hello.scala
$ cat hello.scala
print("hello, this my first scala script")
$ scala hello.scala
hello, this my first scala
帶參數腳本:
$ touch helloargs.scala
$ cat helloargs.scala
print("hello my parameter "+ args(0) + " !") //Java裏面是args[0]
$ scala helloargs.scala mypara
hello my parameter mypara !