Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Inheritance in Java Inheritance in Java Everything Inherits from Object

I am not getting it.

help me with this problem.

Can you post the question? Note: They may be randomized so it's best if you post the question itself.

1 Answer

Allan Clark
Allan Clark
10,810 Points

This is a question about inheritance. when a class inherits from or 'extends' another class it is said to have an 'is-a' relationship. As in, child class 'is a' parent class. so since in the Duck class declaration we see:

class Duck extends Toaster {

then yes a Duck 'is a' Toaster.

They intentionally use nonsense nouns for this example to show its not the name of the classes that is important, it is the relationship that the keyword 'extends' represents.