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
solange tuyisenge
3,081 PointsI am stack on challenge https://teamtreehouse.com/library/build-a-javafx-application/build-a-pomodoro-app/enums task 2
Hello, I am getting an error on this chellenge. below are my codes:
package com.example.model;
public enum Brand {
JVC,SONY,COBY,APPLE;
// Your code here
private String mDisplayName;
Brand(String displayName) {
mDisplayName = displayName;
}
public String getDisplayName() {
return mDisplayName;
}
}
here is the bummer msg i get:
./com/example/model/Brand.java:4: error: constructor Brand in enum Brand cannot be applied to given types;
JVC,SONY,COBY,APPLE;
^
required: String
found: no arguments
reason: actual and formal argument lists differ in length
./com/example/model/Brand.java:4: error: constructor Brand in enum Brand cannot be applied to given types;
JVC,SONY,COBY,APPLE;
^
required: String
found: no arguments
reason: actual and formal argument lists differ in length
./com/example/model/Brand.java:4: error: constructor Brand in enum Brand cannot be applied to given types;
JVC,SONY,COBY,APPLE;
^
required: String
found: no arguments
reason: actual and formal argument lists differ in length
./com/example/model/Brand.java:4: error: constructor Brand in enum Brand cannot be applied to given types;
JVC,SONY,COBY,APPLE;
^
required: String
found: no arguments
reason: actual and formal argument lists differ in length
4 errors
Thank you for assisting
1 Answer
Craig Dennis
Treehouse TeacherDon't forget that when you declare the value, we also now need to pass in a String of how it should be displayed...
COBY("Coby")
Hope it helps!
solange tuyisenge
3,081 Pointssolange tuyisenge
3,081 PointsThanks Craig. It now works.
Solange