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 trialBrett Dube
2,653 Pointscreating the mvp
hie everybody, can someone help me here. i am receivng an error message that says " reached end of line while parsing"
public class ScrabblePlayer {
private String mHand;
public ScrabblePlayer() {
mHand = "";
}
public String getHand() {
return mHand;
}
public void addTile(char tile) {
// Adds the tile to the hand of the player
mHand += tile;
}
public boolean hasTile(char tile) {
boolean currentHand = mHand.indexOf (tile) >=0;
if (currentHand) {
return true;
} else {
return false;
}
}
2 Answers
Logan R
22,989 PointsYou are missing your } after your else block in the last method.
public boolean hasTile(char tile) {
boolean currentHand = mHand.indexOf (tile) >=0;
if (currentHand) {
return true;
} else {
return false;
}
}
}
Brett Dube
2,653 Pointsthank you so much Yonatan, thank you so much Logan. i got it....and its green for Go
Logan R
22,989 PointsSweet :D
Yonatan Schultz
12,045 PointsYonatan Schultz
12,045 PointsYou're missing a closing bracket for your hasTile method. Try checking your code in SublimeText. It has a really nice feature which shows the matching bracket when you select a bracket.