object Person {
// class level functionality
val nEyes = 2
def canFly : Boolean = false
}
class Person (val name: String, val age : Int) {
//instance level functionality
def ageDoubler = age * 2
// def salaryDoubler(salary:Int) = salary*2
}
// companion design pattern
va1 person1 = new Person(“SriRama”, 27)
val person2 = new Person(“SitaRama”, 29)
There is an error in the instance saying the “expected class or object definition”
Need help here. Apologies if the question is repeated.