xxxxxxxxxx
class Person(firstName: String, lastName: String) {
def this(firstName: String) {
// This is an auxiliary constructor
this(firstName, "Doe")
}
def this() {
// This is another auxiliary constructor
this("John")
}
println(s"Creating a Person object for $firstName $lastName")
}