object CheetSheet {
println("Welcome to the Scala worksheet")
def example = 2 // evaluated when called
val example2 = 2 // evaluated immediatly
lazy val example3 = 2 //evaluated once when needed
}
The error message above disappears when the last comment goes to the next line like this:
object CheetSheet {
println("Welcome to the Scala worksheet")
def example = 2 // evaluated when called
val example2 = 2 // evaluated immediatly
lazy val example3 = 2
//evaluated once when needed
}
Error : Missing closing brace
}
assumed hereThe error message above disappears when the last comment goes to the next line like this: