example working with scala 3

Get The Hang

$ 4.2.29 2 502---> scala
Welcome to Scala version 2.9.2 (OpenJDK 64-Bit Server VM, Java 1.6.0_24).
Type in expressions to have them evaluated.
Type :help for more information.

scala> va a, b = 10
:1: error: ';' expected but ',' found.
       va a, b = 10
           ^

scala> val a, b = 10
a: Int = 10
b: Int = 10

scala> a*b
res0: Int = 100

scala> val a, b :String = hello
:7: error: not found: value hello
       val a, b :String = hello
                          ^

scala> var a, b :String = hello
:7: error: not found: value hello
       var a, b :String = hello
                          ^

scala> var a, b :String = "hello"
a: String = hello
b: String = hello

scala> echo a
:8: error: not found: value echo
              echo a
              ^

scala>  a
res2: String = hello

scala>

Leave a comment

Your email address will not be published. Required fields are marked *