环境: 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 !