Pet inheritance

Report a typo

Here are two classes: Pet and Cat:

class Pet {
        
    private String birthDate;
    protected String name;
    
    public String getBirthDate() {
        return birthDate;
    }
        
    public String getName() {
        return name;
    }

    private void setName(String name) {
        this.name = name;
    }
}

class Cat extends Pet { }

Which members of Pet does Cat inherit?

Select one or more options from the list
___

Create a free account to access the full topic