Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道这个文件夹在哪里,如何hello.scala从终端运行
hello.scala
我正在做scala hello.scala,它会产生一个错误
scala hello.scala
/Users/username/Desktop/hello/hello.scala:1: error: illegal start of definition package org.scala ^ one error found
如何运行我的程序?
使用命令时包含包名,scala并针对类文件而不是源代码运行它
scala
scala org.scala.Hello
与 Java 一样,Scala 命名约定表明类以类的首字母大写字母开头,例如Hello
Hello