Class hierarchy

Report a typo

You are given the following class hierarchy:

class Person {

    protected String name;

    public Person(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "Person{name=" + name + "}";
    }
}

class Employee extends Person {

    protected long salary;

    public Employee(String name, long salary) {
        super(name);
        this.salary = salary;
    }
}

Here is an object of the class:

Employee emp = new Employee("Khon", 10_000_000L);

What does the following invocation return?

emp.toString();
Select one option from the list
___

Create a free account to access the full topic