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 Build a JavaFX Application Build a Pomodoro App Enums

Yahya Saadi
Yahya Saadi
4,277 Points

Enums

package com.example.model;


public enum Brand {
  // Your code here 
  JVC("Jvc"),

  SONY("Sony"),

  COBY("Coby"),

  APPLE("Apple");


  private String mName;


  Brand (String displayName) {
    mName = displayName;
  }

  public String getDisplayName() {
    return mName;
  }
}
Ken Alger
Ken Alger
Treehouse Teacher

Edited for markdown

2 Answers

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Yahya;

The display name you have in your code is Jvc, the Challenge would like to see it as JVC. With that change the above code passes with flying colors, or at least with a nifty splash screen. :wink:

Happy coding,
Ken

Ken Alger
Ken Alger
Treehouse Teacher

Yahya;

I wrote a post a while back on enums if you want to take a look at another enum example.

Ken

Yahya Saadi
Yahya Saadi
4,277 Points

Thank you Ken, never thought of that and it worked.

Craig Dennis
STAFF
Craig Dennis
Treehouse Teacher

Looks good what is your error message?

Yahya Saadi
Yahya Saadi
4,277 Points

The error says: BUMMER! I expected to find the display name of 'JVC', but I didn't. Please correct it.