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 trialOmar Ahmed
4,409 Pointswhich 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
Treehouse TeacherHi there, Omar Ahmed ! This part of the quiz wants you to make sure that you're only grooming Dog
s. So we need to check if the object is an instance of Dog
. The instanceof
is what you're looking for
Hope this helps!
Omar Ahmed
4,409 PointsOmar Ahmed
4,409 PointsThank you!