如何运行scala脚本

2025-04-12 13:47:01
推荐回答(1个)
回答1:

脚本:

print("hello
world")

命令:

f:\Scala>scala -savecompiled hello.scala

hello world

脚本:

print("hello world" +args(0))

命令:

f:\Scala>scala -savecompiled hello.scala
hohoho----这个是参数

hello world

如果多个参数:

f:\Scala>scala -savecompiled hello.scala args1
args2