Skip to content

Instantly share code, notes, and snippets.

@deanwampler
Created January 25, 2021 14:52
Show Gist options
  • Save deanwampler/8e1797bf62c5e9b4193eae4014e8263e to your computer and use it in GitHub Desktop.
Save deanwampler/8e1797bf62c5e9b4193eae4014e8263e to your computer and use it in GitHub Desktop.
scala> case class Person(name: String, age: Int):
| def this(name:String) = this(name, 18)
// defined case class Person
scala> Person("Dean", 100)
val res2: Person = Person(Dean,100)
scala> Person("Dean")
1 |Person("Dean")
|^^^^^^^^^^^^^^
|missing argument for parameter age of method apply: (name: String, age: Int): Person
scala> new Person("Dean")
val res3: Person = Person(Dean,18)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment