Scala 脚本

来源:互联网 发布:智能小车pid算法 编辑:程序博客网 时间:2024/05/16 13:40

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

 

1 0
原创粉丝点击