代码之家  ›  专栏  ›  技术社区  ›  KayV

.sc和.scala文件有什么区别?

  •  1
  • KayV  · 技术社区  · 7 年前

    下面是我创建的示例文件:

    我的斯卡拉

    object My {
    
      /** Our main function where the action happens */
      def main(args: Array[String]) {
    
    
        Logger.getLogger("org").setLevel(Level.ERROR)
        val sc = new SparkContext("local[*]", "my")
        val lines = sc.textFile("readme.tx")
        val results = lines.countByValue()
    
       }
    }
    

    理科硕士

    object My {
    
      val hello: String = "Hello World!"
      println(hello)
    }
    

    1 回复  |  直到 7 年前
        1
  •  12
  •   SCouto    7 年前

    scala文件是一个常规的scala文件,以便作为常规程序编译和运行。这是您将使用的mostra scala文件

    编辑

    很好的解释

    What is the difference between scala classes, scripts and worksheets in Intellij-idea?

    推荐文章