Wednesday, 12 August 2020

Scala: semicolons are optional

 Semicolons are optional in Scala.

scala> {
     |   println("Hello World")
     |   println("How are you")
     | }
Hello World
How are you

If you want to keep semicolon, you can do so.

scala> {
     |   println("Hello World");
     |   println("How are you");
     | }
Hello World
How are you

Previous                                                    Next                                                    Home

No comments:

Post a Comment