Skip to content

Instantly share code, notes, and snippets.

@shigemk2
Created March 2, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shigemk2/c6ae24c314753a51ccc9 to your computer and use it in GitHub Desktop.
Save shigemk2/c6ae24c314753a51ccc9 to your computer and use it in GitHub Desktop.
// 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