Tag Archives: java

example working with scala 4 ( Commonly Used Types )

knowledge representation

$ 4.2.29 1 2---> 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> 1.toString
res0: java.lang.String = 1

scala> 33.to(40).toString
res1: String = Range(33, 34, 35, 36, 37, 38, 39, 40)

scala> Jeffrin.intersect(Jose)
:8: error: not found: value Jeffrin
              Jeffrin.intersect(Jose)
              ^

scala> "Jeffrin".intersect("Jose")
res3: String = Je

scala> 

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>