Are you taking CLEP classes? Try clep.ai
| preferred AP College board partner for AP classes
easy Solved by 1 students

Indirect Superclass Inheritance

< Prev
Next >

Which of the following code segments correctly demonstrates a class inheriting a method from an indirect superclass?

A
public class LivingThing { 
    public void breathe() { System.out.println("Breathing"); } 
}

public class Animal { }

public class Mammal extends Animal { }
B
public class Animal {
    public void breathe() {
        System.out.println("Breathing");
    }
}

public class Mammal extends Animal { }
C
public class LivingThing {
    public void breathe() {
        System.out.println("Breathing");
    }
}

public class Animal extends LivingThing { }

public class Mammal extends Animal { }
D
public class LivingThing {
    public void breathe() { System.out.println("Breathing"); }
}

public class Animal extends LivingThing { }

public class Mammal {
    // Does not extend Animal
}
Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question
Mark for review

Question Leaderboard

Not enough data yet to show leaderboard.

No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Privacy Policy|FAQ