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 trialChristopher Harris
1,166 Pointshelp me
why do i have this error code
public class ConferenceRegistrationAssistant {
private String mLineOne = "";
private String mLineTwo = "";
public boolean getLineFor(String lastName) {
/* If the last name is between A thru M send them to line 1
Otherwise send them to line 2 */
boolean whitchLine = lastName.charAt(0) <= 'M';
if (whitchLine) {
mLineOne += lastName;
} else {
mLineTwo += lastName;
}
return whitchLine;
}
}
1 Answer
Michael Freeman
5,674 PointsIf this is the quiz... I believe the objective was to return the line number (1 or 2). So I think you want to return an integer rather than a boolean. In your if statement you'd set the integer variable you are returning to a 1 or a 2 depending on your IF statement.
Christopher Harris
1,166 PointsChristopher Harris
1,166 PointsYh I really went wild here hahahha, thanks for you time