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 trialAlexander Nowak
498 PointsFor each challenge
Hi
Think iv almost got it but could someone please pint out where I'm going wrong?
Thanks
I can't seem to attach my code. How do I do this?
Thanks
1 Answer
Matthew Alexander
14,000 Pointspublic int getTileCount(char specialTile) {
int count = 0;
for (char tile: mHand.toCharArray()) {
if (tile == specialTile) {
count++;
}
}
return count;
}
A very good explanation that helped me is this one
Brett Connolly
12,874 PointsBrett Connolly
12,874 PointsTook me forever to try and figure out before coming here. I'm new to Java so i'm still getting hung up on the way for-loops work compared to other languages and comparisons. This is a little different from the exercise we've been working in so the (tile == specialTile) which, in the exercise context would make more sense as (letter == tile), threw me off.