Black monkey house: Scala parser

1, window + R cmd open input terminal is opened Run

cmd
9193428-ef84e93687b14b3d.png

2, view the version scala, scala environment variable configuration to ensure success

Microsoft Windows [版本 6.1.7601]
版权所有 (c)2009 Microsoft Corporation 保留所有权利。

C:\Users\Administrator> scala -version
Scala code runner version 2.11.8 -- Copyright 2002-2016, LAMP/EPFL

C:\Users\Administrator> 
9193428-0aff42415fa6ba18.png

3, the terminal into the scala

C:\Users\Administrator>scala
Welcome to Scala 2.11.8 (Java HotSpot(TM) 64-Bit Server VM. Java 1.8.0_144).
Type in expressions for evaluation. Or try : help.

scala> 7 * 4 + 2
res0: Int = 30

Interpreter type while also returns the result of this example is Int

4, call the method, you can use the Tab key, the code completion

scala> res0.toString.toUpperCase
res1: String = 30

scala>

Technically, Scala interpreter is not actually happening is that the contents of the input, and is quickly compiled into byte code, and then handed over to the Java Virtual Machine byte code execution, which is why most of the Scala program members prefer, the scala language called "REPL" language

Reproduced in: https: //www.jianshu.com/p/679dd2a5a3d1

Guess you like

Origin blog.csdn.net/weixin_34391854/article/details/91182404