Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// class Person private (name: String)
// val p = new Person("Mercedes")
class Brain private {
override def toString = "This is the brain."
}
object Brain {
val brain = new Brain
def getInstance = brain
}
val brain = Brain.getInstance
println(brain)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.