Here is a trivial scala script:
object test {
def hi() { print(\"hi there from here\") }
}
test.hi()
From the command line it does the expe
There are 2 things to understand first. Scala works as both interpreter and compiler. You are trying to with interpreter "scala test.scala" without using "scalac test.scala" and interpreter works without main method also.
Other way you can do in intellij is open the terminal or command prompt in intellij and run scala test.scala from the file location (Pre-requisite is scala in present the system path)