Spot the error

Report a typo

Being able to spot errors in code is a very useful skill. Can you identify the mistake made in the code below?

class Employee {
    val name: String
    val salary: Int

    constructor(name: String, salary: Int) {
        name = name
        salary = salary
    }
}
Select one option from the list
___

Create a free account to access the full topic