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 Java Objects (Retired) Creating the MVP Comparing Characters

Christopher Harris
Christopher Harris
1,166 Points

help me

why do i have this error code

ConferenceRegistrationAssistant.java
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
Michael Freeman
5,674 Points

If 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
Christopher Harris
1,166 Points

Yh I really went wild here hahahha, thanks for you time