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 trialPrem Yadav
7,346 PointsNot able to solve the problem.
I'm not getting where is the problem in this program. it showing the error of "Brand cannot be applied to given types".
package com.example.model;
public enum Brand {
/*// Your code here
private String JVC;
private String Sony;
private String Coby;
private String Apple;*/
JVC,
SONY,
COBY,
APPLE;
private String mDisplayName;
Brand (String nameOfBrand){
mDisplayName = nameOfBrand;
}
public String getDisplayName(){
return mDisplayName;
}
}
1 Answer
Fahad Mutair
10,359 Pointsyou have to pass argument to the enum
JVC("JVC"),
SONY("Sony"),
COBY("Coby"),
APPLE("Apple");
Prem Yadav
7,346 PointsPrem Yadav
7,346 PointsThanks bro......