Scala学习回顾(一)---- scala的环境搭建
注:本文学习源自:DT大数据梦工厂(微信公众号:DT_Spark)
1、先下载scala安装包:
为后续spark的学习,咱们需要选择版本:2.10.4
http://www.scala-lang.org/download/2.10.4.html
2、安装完后,选择scala IDE,一个是Eclipse scala IDE,另一个是Intellij IDEA
因个人偏爱于Intellij IDEA,故以Intellij IDEA为例。
3、IDEA的使用
①新建Model

②选择scala
③创建项目


④点击src,按Alt + Insert,先创建package,再创建Scala Class

⑤创建scala class时,选择Object

4、编写第一个HelloWorld程序
package com.td.scala.hello /** * 第1讲:helloworld * Created by limin on 2015/7/24. */object HelloScala { def main(args: Array[String]): Unit = { println("Hello Scala!!! A new World!") for(arg <- args) println(arg) }}
运行:
结果:Hello Scala!!! A new World!
也可自定义传入值:


运行输出值:

参考资料:
DT大数据梦工厂微信公众号:DT_Spark
浙公网安备 33010602011771号