Talking with your pets

Report a typo

Let's imagine we have the task of implementing some pet species, to be exact cats and dogs with single ability, they can talk. Each with their language of course.

That is what we are doing in this task. Fill in the blanks so that instances of Cat and Dog would inherit a method and define it their own way.

Fill in the gaps with the relevant elements
interface Pet {
     talk();
}

 Cat   {

    public  () {
        
    }
}

 Dog  Pet {

    public  () {...}
}
talkimplementsPetSystem.out.println("Meow");talkimplementsclassvoidclassvoidvoid

Create a free account to access the full topic