Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
8
Task/String-append/Scala/string-append.scala
Normal file
8
Task/String-append/Scala/string-append.scala
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
var d = "Hello" // Mutables are discouraged //> d : String = Hello
|
||||
d += ", World!" // var contains a totally new re-instantiationed String
|
||||
|
||||
val s = "Hello" // Immutables are recommended //> s : String = Hello
|
||||
val s1 = s + s //> s1 : String = HelloHello
|
||||
val f2 = () => " !" //Function assigned to variable
|
||||
//> f2 : () => String = <function0>
|
||||
println(s1 + f2()); //> HelloHello !
|
||||
Loading…
Add table
Add a link
Reference in a new issue