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

Cole Turner
Cole Turner
5,872 Points

ConferenceRegistrationAssistant: not 100% sure what this code is asking me to do. I defined a Line 1 & Line 2

I'm not sure what I am supposed to do for this exercise. I defined a Line 1 & Line 2 and have the last names sorted accordingly. Can I please have some clarification on what I am supposed to do and how my code is wrong. Thanks!

ConferenceRegistrationAssistant.java
public class ConferenceRegistrationAssistant {

  private String mLine1;
  private String mLine2;

  public int getLineFor(String lastName) {
    /* If the last name is between A thru M send them to line 1
       Otherwise send them to line 2 */

    if (lastName.charAt(0) < 'M') {
      mLine1 = mLine1 + lastName;
    } else {
      mLine2 = mLine2 + lastName;
    }

    int line = 0;
    return line;
  }

}