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

which operator for the dog question

Not sure what to enter for the last question in this quiz

I'm a dog groomer. Help me make sure that I'm only grooming dogs by filling in the blank.

void giveHaircut(Object[] objects) { for (Object object : objects) { if (object (what do I put here?)_ Dog) { // give haircut } } }

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there, Omar Ahmed ! This part of the quiz wants you to make sure that you're only grooming Dogs. So we need to check if the object is an instance of Dog. The instanceof is what you're looking for :smiley:

Hope this helps! :sparkles:

Thank you!