working with scala examples 1

commandline session

$ 4.2.29 15 515---> 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> 4*2-7
res0: Int = 1

scala> res0+1
res1: Int = 2

scala> 2*0.4
res2: Double = 0.8

scala> "hello"
res3: java.lang.String = hello

scala> "hello"+res3
res4: java.lang.String = hellohello

scala> "hello"+res2
res5: java.lang.String = hello0.8

scala> "hello res2"
res6: java.lang.String = hello res2

scala>

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s