Scala basic Concept +ide
Recommended: "Scala Programming"
1 Basic Concepts
In spark development, Scala is considered to be the best-compatible language for current and spark.
Scala run on a standard Java platform that can be used with Java seamless interaction. Scala is a mixture of object-oriented and functional programming into statically typed languages. Characteristics: Object oriented Scala is a purely object-oriented language, each of which is an object, and each operation is a method call Function-type Scala is a mature functional language, functional programming has two guiding principles: 1 Function-type head equivalence, in functional languages, functions are also values, and integer strings are in the same position. Functions can be passed as arguments to other functions. 2 the operation of the program should be to map the input values to output values instead of modifying the data in place. Strong compatibility, Seamless interaction with Java Simple , less than java code is a high-level language is a static language (Perl,Python,Ruby , or Groovy are dynamic languages) |
2 installation Configuration Scala
Scala2.10 above Support Java8 download scala-2.11.4.msi http://downloads.typesafe.com/scala/2.11.4/ scala-2.11.4.msi?_ga=1.214834903.1930730444.1419399344 download scala_home scala the installation directory. PATH environment variables, to include %scala_home%\bin the value. Test:win+r cmd input: scala-version Note: install Scala directly under the D - Packing directory (i installed it in D:d:\program Files (x86) \scala , There was an error in the cmd test:" This should not be Scala\bin\scala.bat " Run Scala File: Scala Xxx.scala Compile Run Xxx.scala file |
---------------------------------------------------- integrated development environment idea or Eclipse-----------------------------------------
3 Ide:eclipse+scala plug-in
(plug-in installation failed, how to solve???? )
Installing Scala in the Eclipse IDE
Scala three types of plugins are available, each supporting Eclipse , NetBeans and the Intellij Idea development environment.
installation is currently unsuccessful when installing the Scala plugin via plugins in the new version of Eclipse .
can download Scala IDE foreclipse this Eclipse version : http://scala-ide.org/download/sdk.html
Unzip after download:
this is Scala Special-Purpose Eclipse
4 Development HelloWorld:
Open Eclipse ( For Scala ):
file-new-- Scala Project, name helloworld-new Scala object, package name test, object name Test
Input:
Package Test
Object Test {
def Main (args: array[String]): unit={
println ("Hello World")
}
}
Output
---------------------------------------------------- integrated development environment idea or Eclipse End-------------------------------------
1 Scala basic Concept +ide